知识卡片
按业务定义去重
去重前先定义一行代表什么。重复传输的同一事件可以只保留一次,两位顾客发生内容相同的交易仍是两个事件。书例用 duplicated 定位重复行,再用 drop_duplicates 保留首次记录。实际应用要先明确检查哪些列以及首条或末条记录的业务含义。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Data Pre-processing · 查看原书依据
In the above programming example, we create a sample DataFrame (`df`) with duplicate rows. We use the duplicated() method to identify duplicate rows in the DataFrame and store them in the duplicates DataFrame. We use the drop_duplicates() method to remove duplicate rows, keeping the
参考来源
- 位置:《Simplified Machine Learning: The Essential Building Blocks for Machine Learning Expertise》第 02 章《Data Pre-processing》(`extracted/Simplified Machine Learningː The Essential Building Blocks for Machine Learning Expertise/_epub-src/OPS/ch02.xhtml`,book-source 项目,正文索引第 168 段)
- 结论依据:原文同时说明领域知识决定删留,并演示选择检查字段及保留规则。
- 原始内容:In the above programming example, we create a sample DataFrame (`df`) with duplicate rows. We use the duplicated() method to identify duplicate rows in the DataFrame and store them in the duplicates DataFrame. We use the drop_duplicates() method to remove duplicate rows, keeping the