运行 ❯
获取
您自己的 Python
服务器
×
更改方向
更改主题,深色/浅色
进入 Spaces
import pandas as pd data = { "name": ["John", "Mary", "John", "Sally", "Mary"], "age": [40, 30, 40, 50, 30], "city": ["Bergen", "Oslo", "Stavanger", "Oslo", "Oslo"] } df = pd.DataFrame(data) s = df.duplicated() print(s) #Column 4 returns True because: #It is identical to column 1.
0 False 1 False 2 False 3 False 4 True dtype: bool