KnowledgeBoat Logo
|

Informatics Practices

Assertion (A). The output of addition of two series will be NaN, if one of the elements or both the elements have no value(s).

Reason (R). While performing mathematical operations on a series, by default all missing values are filled in with 0.

  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 Pandas

2 Likes

Answer

A is true but R is false.

Explanation
When adding two pandas Series and encountering NaN values in either or both Series, the result of the addition operation will be NaN for those corresponding elements. Additionally, pandas does not automatically replace missing values with 0 during mathematical operations but instead with NaN.

Answered By

3 Likes


Related Questions