Skip to content

Sparse becomes float under fancy indexing #14166

@jnothman

Description

@jnothman
Contributor
>>> 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.

Activity

jreback

jreback commented on Sep 7, 2016

@jreback
Contributor

in master/0.19.0 (rc1 comes out this week)

http://pandas-docs.github.io/pandas-docs-travis/whatsnew.html#sparse-changes

In [1]: pd.SparseSeries([False, True], dtype=bool)[[0, 1]]
Out[1]: 
0    False
1     True
dtype: bool
BlockIndex
Block locations: array([1], dtype=int32)
Block lengths: array([1], dtype=int32)
added this to the No action milestone on Sep 7, 2016
jnothman

jnothman commented on Sep 7, 2016

@jnothman
ContributorAuthor

Great.

On 7 September 2016 at 10:15, Jeff Reback notifications@github.com wrote:

in master/0.19.0 (rc1 comes out this week)

In [1]: pd.SparseSeries([False, True], dtype=bool)[[0, 1]]
Out[1]:
0 False
1 True
dtype: bool
BlockIndex
Block locations: array([1], dtype=int32)
Block lengths: array([1], dtype=int32)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#14166 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz6_YBbzib9rBG3whtH5tqZh0nnbAoks5qngI1gaJpZM4J2ZaC
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @jnothman@jreback

        Issue actions

          Sparse becomes float under fancy indexing · Issue #14166 · pandas-dev/pandas