Pandas - Creating Data Frames Flashcards

Learn Pandas Data Frame

1
Q

What are the most important things in Data Frame ?

A

These are , Index,Colums & Data

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

What is the most important property of Data Frame ?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to know the total index value in Data Fame ?

A

df.index

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

How to present , only Column Names of Data Frame ?

A

df.columns

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

How many options to select rows & colums in Data Frame ?

A

Two Options :

  1. Index Integer Position.
  2. Labels
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a best thing to filter rows & columns of Data Frame ?

A

The best way to filter data frame is , column filtering by colums Labels & row filtering by position index?

df[[‘Name’,’Age’]][:’B’]

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

How to present single column by dot notaion ?

A

df. Name

df. Age

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

In what condition we cant use dot notation for presenting columns ?

A

When column labels have space between them like,

‘Full Name’ .

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

How to know the object type of pandas dataframe column ?

A

print(type(df[‘Name’]))

print(type(df.Name))

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

What are the methods in python to access rows & columns of pandas Data Frame ?

A

loc method for column selection

iloc method for row selection

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

How many ways to acces data frame colums in pandas ?

A

1 . using square brackets df.[‘Name’]

  1. using dot notation df.Name
  2. using loc & iloc method df.loc[:,[‘Name’,’Age’]]
    df. iloc[:,:]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the correct way to use slice with loc method ?

A

Colon is not allowed in list,use coma to separate.

df. loc[[‘A’,’B’],[‘Name’,’City’]]
df. loc[‘A’:’C’,’Name’]

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