How to Insert, Delete, Update in Pandas DataFrames
Get Job-Ready: Data Analysis using Python with 70+ Projects Start Now!!
Program 1
import pandas as pd
emp=pd.read_excel("E:\mypandas\employee.xlsx")
#print(emp)
#emp=emp._append({'id':36,'empname':'Rohit Sharma','empdept':'CS','gender':'M','age':39,'HRA':5000,'TA':7000,'DA':8000,'salary':20000},ignore_index=True)
# print(emp)
# print("---------------After Update----------------------")
# emp.loc[emp['salary']==15000,'salary']=25000
# print(emp[emp.salary==25000])
#print(emp)
emp=emp.drop(emp[emp.salary==10000].index)
print(emp)
# _append()
# loc()
# drop()
Did you like this article? If Yes, please give DataFlair 5 Stars on Google


Nice lectures sir, I really Like your teaching.
Sir please make videos on machine learning algorithms.