CBSE Class 12 Informatics Practices
Question 8 of 167
Python Pandas — I — Question 8
Back to all questions 8
Question Assertion. While changing the values of a column in a dataframe, if the column does not exist, an error occurs.
Reason. If values are provided for a non-existing column in a dataframe, a new column is added with those values.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
A is false but R is true.
Explanation
While changing the values of a column in a dataframe where the column does not exist does not cause an error. Instead, a new column with those values is added to the dataframe. If values are provided for a non-existing column in a dataframe, a new column is added with those values.