Skip to content

Sparse becomes float under fancy indexing #14166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jnothman opened this issue Sep 6, 2016 · 2 comments
Closed

Sparse becomes float under fancy indexing #14166

jnothman opened this issue Sep 6, 2016 · 2 comments
Labels
Dtype Conversions Unexpected or buggy dtype conversions Sparse Sparse Data Type

Comments

@jnothman
Copy link
Contributor

jnothman commented Sep 6, 2016

>>> 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.

@jreback
Copy link
Contributor

jreback commented Sep 7, 2016

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)

@jreback jreback closed this as completed Sep 7, 2016
@jreback jreback added Sparse Sparse Data Type Dtype Conversions Unexpected or buggy dtype conversions labels Sep 7, 2016
@jreback jreback added this to the No action milestone Sep 7, 2016
@jnothman
Copy link
Contributor Author

jnothman commented Sep 7, 2016

Great.

On 7 September 2016 at 10:15, Jeff Reback [email protected] 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
Labels
Dtype Conversions Unexpected or buggy dtype conversions Sparse Sparse Data Type
Projects
None yet
Development

No branches or pull requests

2 participants