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

Closed
immerrr opened this Issue Sep 17, 2014 · 1 comment

Comments

Projects
None yet
2 participants
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')
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 added this to the 0.16 milestone Sep 17, 2014

@jreback jreback modified the milestone: 0.16, 0.15.1 Oct 7, 2014

@jreback jreback modified the milestone: 0.16.0, Next Major Release Mar 6, 2015

@jreback jreback modified the milestone: 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