data.drop_duplicates(keep='first',inplace =True)
时间: 2024-06-03 18:07:24 浏览: 162
Python DataFrame使用drop_duplicates()函数去重(保留重复值,取重复值)
5星 · 资源好评率100%
This code drops duplicate rows from a pandas dataframe called "data".
The "keep" parameter is set to "first", which means that the first occurrence of each duplicated row is kept, and subsequent duplicates are dropped.
The "inplace" parameter is set to "True", which means that the original dataframe is modified in place rather than creating a new dataframe with the duplicates removed.
阅读全文