Pandas - Creating Data Frames Flashcards
Learn Pandas Data Frame
What are the most important things in Data Frame ?
These are , Index,Colums & Data
What is the most important property of Data Frame ?
The most important property of Data Frame is,
every column in a data frame is an Series Object,Series is one dimension data structure.
How to know the total index value in Data Fame ?
df.index
How to present , only Column Names of Data Frame ?
df.columns
How many options to select rows & colums in Data Frame ?
Two Options :
- Index Integer Position.
- Labels
What is a best thing to filter rows & columns of Data Frame ?
The best way to filter data frame is , column filtering by colums Labels & row filtering by position index?
df[[‘Name’,’Age’]][:’B’]
How to present single column by dot notaion ?
df. Name
df. Age
In what condition we cant use dot notation for presenting columns ?
When column labels have space between them like,
‘Full Name’ .
How to know the object type of pandas dataframe column ?
print(type(df[‘Name’]))
print(type(df.Name))
What are the methods in python to access rows & columns of pandas Data Frame ?
loc method for column selection
iloc method for row selection
How many ways to acces data frame colums in pandas ?
1 . using square brackets df.[‘Name’]
- using dot notation df.Name
- using loc & iloc method df.loc[:,[‘Name’,’Age’]]
df. iloc[:,:]
What is the correct way to use slice with loc method ?
Colon is not allowed in list,use coma to separate.
df. loc[[‘A’,’B’],[‘Name’,’City’]]
df. loc[‘A’:’C’,’Name’]