Advertisements
Advertisements
Question
When two Pandas Series with different indices are added, the result is ______.
Options
Error occurs
Indices are ignored, and elements are added in order.
The result has all indices, with missing values filled as NaN.
Only the common indices are retained in the result.
MCQ
Advertisements
Solution
The result has all indices, with missing values filled as NaN.
Explanation:
When two Pandas Series with different indices are added, Pandas aligns the data by index labels. If an index is missing in one Series, the result for that index becomes NaN (Not a Number). Thus, the output contains all indices from both series, and missing values are replaced with NaN.
shaalaa.com
Is there an error in this question or solution?
