Skip to content

Sparse becomes float under fancy indexing #14166

Closed
@jnothman

Description

@jnothman
>>> pd.SparseSeries([False, True], dtype=bool)[[0, 1]]
0    0.0
1    1.0
dtype: float64
BlockIndex
Block locations: array([1], dtype=int32)
Block lengths: array([1], dtype=int32)

Expected output

0    False
1    True
dtype: bool
BlockIndex
Block locations: array([1], dtype=int32)
Block lengths: array([1], dtype=int32)

Output of pd.versions()

pandas: 0.18.1

should alone be relevant.

Apologies I've not checked if this is fixed by #13849 or elsewhere. Just passing on issues from
scikit-learn/scikit-learn#7352.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dtype ConversionsUnexpected or buggy dtype conversionsSparseSparse Data Type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions