import numpy as np
from pandas import DataFrame
test = [['a','a'],
['a','b'],
['a','a'],
['c','b']
]
test = DataFrame(np.array(test))
test1 = test.drop_duplicates(keep='first')#删除重复项并保留第一次出现的额重复项
test2 = test.drop_duplicates([0],keep='first')#在第0列删除重复项
test2 = test.drop_duplicates([1],keep='first')#在第一列删除重复项
print(test)
print(test1)
print(test2)
0 1
0 a a
1 a b
2 a a
3 c b
0 1
0 a a
1 a b
3 c b
0 1
0 a a
1 a b