Pandas: Data Handling Techniques Flashcards
Panda stands for ?
Python Data Analysis Library
How to install Pandas
pip install pandas
How to import Pandas module ?
import pandas as pd
How to import csv file ?
dataFrame=pd.read_csv('Book.csv')
How to get first n rows ?
head=dataFrame.head(10)
How to get last n rows ?
tail=dataFrame.tail(10)
How to get all row and column values in the data frame ?
We have to use shape property.
~~~
row,column=dataFrame.shape
~~~
How to save specific rows in available ?
It will save to row5 to row 10 data in a variable.
~~~
speciFicRows=dataFrame[5:10]
~~~
How to get all rows from n row to last ?
speciFicRows=dataFrame[5:]
How to get only specific column in a variable
column1=dataFrame.Income
How to get multiple columns in a variable ?
column2=dataFrame[['Age','Income']]
How to get specific row and columns in variable ?
x=dataFrame.iloc[0:4,0:3]
Which Panda method is label based ?
df.loc[]
Which Pandas method is integer index value based ?
df.iocl[]
How to get the minimum and maximum value of columns ?
df.Age.max() df.Age.min()