Pandas Flashcards
Numpy arrays require which type of data?
Homogeneous data
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?
ValueError
Name the two types of indexes in a pandas series.
Positional index and labelled index.
In what type of index is the last value of the given ratio is also displayed in the output?
Labelled index
Is the last value of the given ratio updated in slicing when the indexes are positional?
No. The value is excluded when the index is poisitional, included when it is labelled.
While using DataFrame.loc[], if you add values in a row lesser than the number of columns, what error message does python display?
ValueError: Cannot set a row with mismatched columns.
While using DataFrame.loc[], if you add values in a column lesser than the number of rows, what error message does python display?
ValueError: Length of values does not match the lengh of index.
When a row label is passed as in integer value in the function DataFrame.loc[], how is it interpreted?
It is interpreted as a label of the index and not as an integer position along the index.
is slicing inclusive of end values in DataFrames?
Yes.
What is DataFrame.dtypes used for?
To display the data type of each column in the DataFrame.
What is DataFrame.values used for?
To display a Numpy ndarray having all the values in the DataFrame, without the axes labels.
What is DataFrame.shape used for?
To display a tuple representing the dimensionality of the DataFrame.