Analyzing DataFrames - PANDAS (Analyzing DataFrames) Flashcards

1
Q

One of the most used method for getting a quick overview of the DataFrame, is the head() method.

A

Viewing the Data

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

The head() method returns the headers and a specified number of rows, starting from the top.

A

Viewing the Data

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

if the number of rows is not specified, the head() method will return the top 5 rows.

A

print(df.head())

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

There is also a tail() method for viewing the last rows of the DataFrame.

A

print(df.tail())

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

The tail() method returns the headers and a specified number of rows, starting from the bottom.

A

print(df.tail())

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

The DataFrames object has a method called info(), that gives you more information about the data set.

A

print(df.info())

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

The info() method also tells us how many Non-Null values there are present in each column

A

Null Values

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

Empty values, or Null values, can be bad when analyzing data, and you should consider removing rows with empty values.

A

Null Values

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

Exercise - What is a correct syntax for printing the first 10 rows of a DataFrame?

A

print(df.head(10))

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

Exercise - What is a correct syntax for printing the last 10 rows of a DataFrame?

A

print(df.tail(10))

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

Exercise - True or False. If number of rows is not specified, the tail() method will return all rows.

A

False

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