Explain how to select data from multiple columns based on criteria.
For selecting multiple data based on criteria, we have to create a simple dataframe to illustrate the dataset.
import pandas as pd
df = pd.DataFrame({'col1':[1,2,3,4],'col2':[444,555,666,444],'col3':['abc','def','ghi','xyz']})
df.head()
Now we Select from DataFrame using criteria from multiple columns
newdf = df[(df['col1']>2) & (df['col2']==444)]
newdf