Pandas: Data Handling Techniques Flashcards

1
Q

Panda stands for ?

A

Python Data Analysis Library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How to install Pandas

A
pip install pandas
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to import Pandas module ?

A
import pandas as pd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to import csv file ?

A
dataFrame=pd.read_csv('Book.csv')
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to get first n rows ?

A
head=dataFrame.head(10)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to get last n rows ?

A
tail=dataFrame.tail(10)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to get all row and column values in the data frame ?

A

We have to use shape property.
~~~
row,column=dataFrame.shape
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to save specific rows in available ?

A

It will save to row5 to row 10 data in a variable.
~~~
speciFicRows=dataFrame[5:10]
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to get all rows from n row to last ?

A
speciFicRows=dataFrame[5:]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to get only specific column in a variable

A
column1=dataFrame.Income
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to get multiple columns in a variable ?

A
column2=dataFrame[['Age','Income']]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to get specific row and columns in variable ?

A
x=dataFrame.iloc[0:4,0:3]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which Panda method is label based ?

A

df.loc[]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which Pandas method is integer index value based ?

A
df.iocl[]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to get the minimum and maximum value of columns ?

A
df.Age.max()
df.Age.min()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to get mean of column Numerical values ?

A
df.Age.mean()
17
Q

How to get standard deviation of numeric values in colum ?

A
df.Age.std()
18
Q

How to use describe method to describe dataframe?

A
include =['object', 'float', 'int']
percentile=[.5, .10, .20, .40, .60, .80]
df.describe(percentiles = percentile,include = include)