Skip to content
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

Series[sparse].to_sparse messes up length #22389

Closed
TomAugspurger opened this issue Aug 16, 2018 · 0 comments
Closed

Series[sparse].to_sparse messes up length #22389

TomAugspurger opened this issue Aug 16, 2018 · 0 comments
Labels
Sparse Sparse Data Type
Milestone

Comments

@TomAugspurger
Copy link
Contributor

In [23]: a = pd.Series(pd.SparseArray([1, 2, None, 2]))

In [24]: b = a.to_sparse()

In [25]: len(a), len(b)
Out[25]: (4, 3)

In [26]: b
Out[26]:
0    1.0
1    2.0
2    2.0
3
dtype: float64
IntIndex
Indices: array([0, 1, 2], dtype=int32)

Fixing in #22325, this is to link from the release notes.

@TomAugspurger TomAugspurger added the Sparse Sparse Data Type label Aug 16, 2018
@TomAugspurger TomAugspurger added this to the 0.24.0 milestone Aug 16, 2018
TomAugspurger added a commit to TomAugspurger/pandas that referenced this issue Aug 18, 2018
tm9k1 pushed a commit to tm9k1/pandas that referenced this issue Nov 19, 2018
Makes SparseArray an ExtensionArray.

* Fixed DataFrame.__setitem__ for updating to sparse.

Closes pandas-dev#22367

* Fixed Series[sparse].to_sparse

Closes pandas-dev#22389

Closes pandas-dev#21978
Closes pandas-dev#19506
Closes pandas-dev#22835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sparse Sparse Data Type
Projects
None yet
Development

No branches or pull requests

1 participant