Skip to content

API: setting np.nan into Series[bool] #38692

Closed
@jbrockmendel

Description

@jbrockmendel
ser = pd.Series([True, False, True, False])
ser[0] = np.nan

>>> ser
0    NaN
1    0.0
2    1.0
3    0.0
dtype: float64

It would be more consistent (and would simplify the code) if this cast to object and did not convert True/False to 1.0/0.0. ATM we have 2 tests that such a change would break.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API - ConsistencyInternal Consistency of API/BehaviorDtype ConversionsUnexpected or buggy dtype conversions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions