美文网首页
Pandas去重函数

Pandas去重函数

作者: Viterbi | 来源:发表于2022-11-19 12:43 被阅读0次

pandas去重函数

  • df.drop_duplicates?

    • Signature: df.drop_duplicates(subset=None, keep='first', inplace=False)
  • Docstring:

    • Return DataFrame with duplicate rows removed, optionally only considering certain columns

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


deduplicated :DataFrame

本文使用 文章同步助手 同步

相关文章

网友评论

      本文标题:Pandas去重函数

      本文链接:https://www.haomeiwen.com/subject/knpzzrtx.html