injured.iloc = injured.iloc.mask(injured.iloc != injured_manual_sum, np.nan)
What I expected to happen:
the ‘total_injured’ series, where the values that were not identical to the ‘injured_manual_sum’ values, would be replaced with a null value.
What actually happened:
ValueError: Can only compare identically-labeled Series objects
this code works as expected when I replace
injured['total_injured'] even if only inside the Series.mask() method. I thought that those two names are just different ways to call the same series and should be interchangeable. Is there something else that I am missing? Thanks!