美文网首页
Python-118 删除重复的行delete duplicat

Python-118 删除重复的行delete duplicat

作者: RashidinAbdu | 来源:发表于2021-08-27 17:43 被阅读0次
    • 1.删除重复行:

    • In the output, we can see that it removes duplicated rows. It is the default behavior of the drop_duplicate() function.
    • It retains the first value and removes further duplicates.

    import pandas as pd
    data = pd.read_excel('C:\Temp\data.xlsx')# file destination
    #print(data)
    data.drop_duplicates()
    


    • 2.删除重复列:


    • Reference:
    https://www.sqlshack.com/removing-duplicates-in-an-excel-sheet-using-python-scripts/
    
    https://www.sqlshack.com/python-scripts-to-format-data-in-microsoft-excel/
    

    相关文章

      网友评论

          本文标题:Python-118 删除重复的行delete duplicat

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