How to Insert, Delete, Update in Pandas DataFrames

Free Pandas course with real-time 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 we exceed your expectations?
If Yes, share your valuable feedback on Google

follow dataflair on YouTube

2 Responses

  1. Apurva Waghmode says:

    Nice lectures sir, I really Like your teaching.

  2. Apurva Waghmode says:

    Sir please make videos on machine learning algorithms.

Leave a Reply

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