Informatics Practices

Assertion (A): When a dataframe is created using dictionary, the keys will be the columns and corresponding values will be the rows of the dataframe.

Reasoning (R): NaN values are automatically filled for values of non-matching keys while creating a dataframe using dictionary.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Data Handling

3 Likes

Answer

Both A and R are true and R is the correct explanation of A.

Explanation
When a dataframe is created using a dictionary, the keys of the dictionary become the columns of the dataframe, and the values of the dictionary become the rows of the dataframe. If the dictionaries used to create the dataframe have non-matching keys, NaN values will be automatically filled in for the missing values.

Answered By

1 Like


Related Questions