Closed inanoll2 closed 3 years ago
Since 'Utah'
is not present in obj4
, is it treated as missing and so yields missing (null / NaN) in the result. You can get around this by using the add
method:
>>> obj3.add(obj4, fill_value=0)
California NaN
Ohio 70000.0
Oregon 32000.0
Texas 142000.0
Utah 5000.0
dtype: float64
This treats missing index values in obj3
or obj4
as 0
I have a question: when adding both obj 3 + 4, the result shows NaN for "Utah". However, in obj3, its value is 5000.
Why does it add values for Ohio, Oregon and Texas, but not for Utah? I would have expected it to show 5000.
Thanks for helping out.