s1 has index [1, 2, 3] and s2 has index [2, 3, 4]. What is the result of s1 + s2?
Correct answer
C. A Series indexed 1 to 4, with NaN at 1 and 4
13 views
C. A Series indexed 1 to 4, with NaN at 1 and 4
13 views
Arithmetic between Series aligns on the index labels and takes the union of the two indexes; labels 1 and 4 appear on one side only, so they hold NaN instead of raising an error or being summed by position.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is C? Ask here and get an explanation.