How to Apply Filter in Pandas DataFrame

Free Pandas course with real-time projects Start Now!!

Program 1

import pandas as pd
df=pd.read_excel("E://mypandas/employee.xlsx")
#print(df.loc[df['totalsalary']>10000])
#print(df.loc[~(df['gender']=='male') & (df['totalsalary']>10000)])
#print(df.loc[(df['empdept']=='CS') | (df['gender']=='male')])
#print(df.loc[df['empname'].str.contains('a')])

 

We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

follow dataflair on YouTube

Leave a Reply

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