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

BUG: int sparse series is converted to float if sliced #8292

Closed
immerrr opened this issue Sep 17, 2014 · 1 comment · Fixed by #13849
Closed

BUG: int sparse series is converted to float if sliced #8292

immerrr opened this issue Sep 17, 2014 · 1 comment · Fixed by #13849
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Sparse Sparse Data Type
Milestone

Comments

@immerrr
Copy link
Contributor

immerrr commented Sep 17, 2014

This looks weird:

In [1]: pd.__version__
Out[1]: '0.14.1-388-g54678dd'

In [2]: sp_series = pd.Series([0,0,1]).to_sparse(fill_value=0)

In [3]: sp_series.dtype
Out[3]: dtype('int64')

In [4]: sp_series[::-1].dtype
Out[4]: dtype('float64')

In [5]: sp_series[::2].dtype
Out[5]: dtype('float64')

In [6]: sp_series[:-1].dtype
Out[6]: dtype('float64')
@jreback
Copy link
Contributor

jreback commented Sep 17, 2014

Sparse < 0.13 didn't support anything except float64, so this is no surpise. Things always coerced to float before most operations.

@jreback jreback added API Design Sparse Sparse Data Type Bug Dtype Conversions Unexpected or buggy dtype conversions and removed API Design labels Sep 17, 2014
@jreback jreback added this to the 0.16 milestone Sep 17, 2014
@jreback jreback modified the milestones: 0.16, 0.15.1 Oct 7, 2014
@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@jreback jreback modified the milestones: 0.19.0, Next Major Release Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants