码迷,mamicode.com
首页 > 其他好文 > 详细

pandas.DataFrame.drop_duplicates

时间:2019-11-22 22:11:05      阅读:83      评论:0      收藏:0      [点我收藏+]

标签:size   iter   str   void   span   ide   time   exce   for   

DataFrame.drop_duplicates(self, subset=None, keep=‘first‘, inplace=False)

Return DataFrame with duplicate rows removed, optionally only considering certain columns. Indexes, including time indexes are ignored.

Parameters:
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

Whether to drop duplicates in place or to return a copy

Returns:
DataFrame

pandas.DataFrame.drop_duplicates

标签:size   iter   str   void   span   ide   time   exce   for   

原文地址:https://www.cnblogs.com/zjuhaohaoxuexi/p/11914447.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!