📜  数据框删除具有相同列值的重复行 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:02.018000             🧑  作者: Mango

代码示例6
df = df.drop_duplicates(subset=['Column1', 'Column2'], keep='first')

# Exemple
import pandas as pd
df = pd.DataFrame({"A":["foo", "foo", "foo", "bar"], "B":[0,1,1,1], "C":["A","A","B","A"]})
df.drop_duplicates(subset=['A', 'C'], keep=False)