Python Flashcards

1
Q

How do you load pandas?

A

Import pandas as pd

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

How do you load a csv file?

A

variable (eg ‘data’) = pd.read.csv(“file_name.csv”)

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

How to see the first 5 rows of a variable named ‘data’?

A

data.head()

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

How to see the list of all the columns in a variable name ‘data’?

A

data.columns

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

How to see the size of a dataset named ‘data’?

A

data.shape

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

What is the shortcut to add a block below in Jupyter?

A

Use Esc, b to add line below

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

What is the shortcut to add a block above in Jupyter?

A

Use Esc, a to add line above

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

What is the shortcut to delete a block in Jupyter?

A

Use Esc, x to delete a line

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

What is shortcut to undo in Jupyter?

A

Use Esc, z to undo

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

How to turn a block in to a markdown block (to create headings etc)?

A

Esc, m

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

How to turn a block back into an execution block?

A

Esc, y

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