Pandas Flashcards

1
Q

Numpy arrays require which type of data?

A

Homogeneous data

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

Index labels are passed with the array. If the lenght of the index and array is not the same, then what kind of an error with python show?

A

ValueError

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

Name the two types of indexes in a pandas series.

A

Positional index and labelled index.

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

In what type of index is the last value of the given ratio is also displayed in the output?

A

Labelled index

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

Is the last value of the given ratio updated in slicing when the indexes are positional?

A

No. The value is excluded when the index is poisitional, included when it is labelled.

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

While using DataFrame.loc[], if you add values in a row lesser than the number of columns, what error message does python display?

A

ValueError: Cannot set a row with mismatched columns.

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

While using DataFrame.loc[], if you add values in a column lesser than the number of rows, what error message does python display?

A

ValueError: Length of values does not match the lengh of index.

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

When a row label is passed as in integer value in the function DataFrame.loc[], how is it interpreted?

A

It is interpreted as a label of the index and not as an integer position along the index.

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

is slicing inclusive of end values in DataFrames?

A

Yes.

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

What is DataFrame.dtypes used for?

A

To display the data type of each column in the DataFrame.

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

What is DataFrame.values used for?

A

To display a Numpy ndarray having all the values in the DataFrame, without the axes labels.

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

What is DataFrame.shape used for?

A

To display a tuple representing the dimensionality of the DataFrame.

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