0

Why is df.resample() changing the dates when I resample?

X

Before

What I want this to do is insert one row with index '2014-07-01' and value NaN.

X.resample('12M').last()

after`

Mose Wintner
  • 290
  • 1
  • 10

1 Answers1

2

Try with MS

out = df.resample('12MS').first()
Out[33]: 
              0
2014-07-01  1.0
2015-07-01  NaN
2016-07-01  2.0
2017-07-01  3.0
BENY
  • 317,841
  • 20
  • 164
  • 234