You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #53682 and #53762. When dealing with those two issues, I incorrectly assumed that complex nans are all in the form nan+0j, but in fact it is considered nan (i.e., isnan evaluates to True) if either the real or imaginary part is nan, for instance nan+2j, 2+nanj, nan+nanj, etc. IMO we need more explicit rules than isnan when distinguishing different kinds of complex nans, and maybe the display part need to be adjusted as well since previously I only considered the case that the real part can be nan. I will do further investigations and try to make a PR ASAP.
Note that this is completely a display issue because ser.array stores the values correctly.
Charlie-XIAO
changed the title
BUG: complex Series/DataFrame treat all complex nans as nan+0j
BUG: complex Series/DataFrame display all complex nans as nan+0jJun 25, 2023
Pandas version checks
Reproducible Example
Issue Description
Related to #53682 and #53762. When dealing with those two issues, I incorrectly assumed that complex nans are all in the form
nan+0j
, but in fact it is considered nan (i.e.,isnan
evaluates toTrue
) if either the real or imaginary part is nan, for instancenan+2j
,2+nanj
,nan+nanj
, etc. IMO we need more explicit rules thanisnan
when distinguishing different kinds of complex nans, and maybe the display part need to be adjusted as well since previously I only considered the case that the real part can be nan. I will do further investigations and try to make a PR ASAP.Note that this is completely a display issue because
ser.array
stores the values correctly.Expected Behavior
Installed Versions
Installed versions
The text was updated successfully, but these errors were encountered: