How to Drop Duplicate Values From Pandas DataFrame

Get Job-Ready: Data Analysis using Python with 70+ 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")

 

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

Your email address will not be published. Required fields are marked *