本文主要是介绍pandas熊猫库.drop_duplicates()去除重复项,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
先看help的结果
>>> help(data.drop_duplicates)
Help on method drop_duplicates in module pandas.core.frame:drop_duplicates(subset:collections.abc.Hashable=None, keep:Union[str, bool]='first', inplace:bool=False, ignore_index:bool=False) -> Union[_ForwardRef('DataFrame'), NoneType] method of pandas.core.frame.DataFrame instanceReturn DataFrame with duplicate rows removed.Considering certain columns is optional. Indexes, including time indexesare ignored.Parameters----------subset : column label or sequence of labels, optionalOnly consider certain columns for identifying duplicates, bydefault use all of the columns.keep : {'first', 'last', False}, default 'first'Determines which duplicates (if any) to keep.- ``first`` : Drop duplicates except for the first occurrence.- ``
这篇关于pandas熊猫库.drop_duplicates()去除重复项的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!