0

I'm plotting series with datetime indexes but this just gets too messy so I am changing the days to numbers. I have 400 days split as 250-150 (2 series) and for the first series

I can just do pd.Series.reset_index(drop=True) which gives me index from 0 to 249. Now for the second series I want the same but I want the indexes from 250 to 399 and neither pd.Series.reindex() , pd.Series.reset_index nor set_index can do that. I found a work around namely:

pd.Series(data=SERIES2.tolist(),index=pd.RangeIndex(start=250,stop=400))

I hope that there is actually an official way. Thanks in advance

Aderbal Farias
  • 989
  • 10
  • 24
dejoma
  • 394
  • 1
  • 6
  • 18
  • In my opinion your solution is nice, but what is code for ploting? Is necessary chang index? Is not possible reuse `SERIES1.index` for `ploting SERIES2` ? – jezrael Apr 06 '19 at 10:43
  • Why not just slice the ranges you want? Resetting the index is surely causing the problem here? – roganjosh Apr 06 '19 at 10:44
  • @roganjosh what do you mean slice the ranges? The problem is that there does not exist a way to 'overwrite' an index without resetting it. – dejoma Apr 07 '19 at 11:14

0 Answers0