Inplace operation on PeriodIndex cast it to Int64Index #6527

Closed
dhirschfeld opened this Issue Mar 3, 2014 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

dhirschfeld commented Mar 3, 2014

In [1]: dates = pd.period_range('01-Jan-2015', '01-Jan-2016', freq='M')
   ...: series = pd.TimeSeries(np.arange(dates.size), dates)
   ...: 

In [2]: series
Out[2]: 
2015-01     0
2015-02     1
2015-03     2
2015-04     3
2015-05     4
2015-06     5
2015-07     6
2015-08     7
2015-09     8
2015-10     9
2015-11    10
2015-12    11
2016-01    12
Freq: M, dtype: int32

In [3]: series.index += 1

In [4]: series
Out[4]: 
541     0
542     1
543     2
544     3
545     4
546     5
547     6
548     7
549     8
550     9
551    10
552    11
553    12
dtype: int32

In [5]: series.index
Out[5]: Int64Index([541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553], dtype='int64')

In [6]: pd.__version__
Out[6]: '0.13.1-339-g6c3755b'

jreback added this to the 0.15.0 milestone Mar 3, 2014

Contributor

jreback commented Mar 3, 2014

related to #5202

Period ops not real well supported ATM.. feel free to do a PR!

@jreback jreback modified the milestone: 0.15.0, 0.15.1 Jul 19, 2014

jreback closed this in #7741 Jul 23, 2014

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