How to Drop Duplicate Values From Pandas DataFrame
Free Pandas course with real-time projects Start Now!!
Program 1
import pandas as pd df=pd.read_excel("E://mypandas/mydata.xlsx",sheet_name='employee') print(df.duplicated()) df.drop_duplicates(inplace=True) print("-------------------After Drop------------------") print(df.duplicated()) df.to_excel("E://mypandas/newdata.xlsx") #print(df) print("Success")
Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google