CBSE Class 12 Informatics Practices
Question 12 of 44
Data Handling using Pandas — Question 13
Back to all questionspencils False
notebooks False
scales False
erasers False
dtype: bool
pencils 37
notebooks 46
scales 83
erasers 42
dtype: int64
The code creates two pandas Series, S and S2, with the index Stationery which is a list. The code then compares S and S2 element-wise using the "==" operator, which returns a boolean Series indicating whether each pair of values is equal. Finally, the code adds S and S2 element-wise using the "+" operator, which returns a new Series with the summed values, and assigns the result back to S. The resulting S Series will have the same index as before i.e., Stationery.