DataFrame.drop_duplicates(subset=None, keep='first', inplace=False)
method of pandas.core.frame.DataFrame instance Return DataFrame with duplicate(重复) rows removed, optionally only considering certain columns
subset : column label or sequence of labels, optional 用来指定特定列,默认所有列
Only consider certain columns for identifying duplicates, by default use all of the columns
keep : {'first', 'last', False}, default 'first'去掉重复,默认保留第一次出现的
- ``first`` : Drop duplicates except for the first occurrence.
- ``last`` : Drop duplicates except for the last occurrence.
- False : Drop all duplicates.
inplace : boolean, default False 是否在原dataframe上修改还是保存一个副本
Whether to drop duplicates in place or to return a copy
Returns
-------
deduplicated : DataFrame