Closed
Description
I'm up-sampling quarterly data to monthly periods and using a fill method which is working fine, but then when I pass in an argument for "how", it seems to disable the filling feature.
My understanding was that "how" doesn't mean anything in the context of up-sampling, in which case I would expect passing the parameter to have no effect on the output.
Is this a bug or am I missing something about how this is supposed to work?
See below (pandas 0.8.1):
In [18]: s = pandas.Series(range(9), index=pandas.date_range('2010-01-01', periods=9, freq='Q'))
In [19]: s
Out[19]:
2010-03-31 0
2010-06-30 1
2010-09-30 2
2010-12-31 3
2011-03-31 4
2011-06-30 5
2011-09-30 6
2011-12-31 7
2012-03-31 8
Freq: Q-DEC
In [20]: s.resample('M', fill_method='ffill')
Out[20]:
2010-03-31 0
2010-04-30 0
2010-05-31 0
2010-06-30 1
2010-07-31 1
2010-08-31 1
2010-09-30 2
2010-10-31 2
2010-11-30 2
2010-12-31 3
2011-01-31 3
2011-02-28 3
2011-03-31 4
2011-04-30 4
2011-05-31 4
2011-06-30 5
2011-07-31 5
2011-08-31 5
2011-09-30 6
2011-10-31 6
2011-11-30 6
2011-12-31 7
2012-01-31 7
2012-02-29 7
2012-03-31 8
Freq: M
In [21]: s.resample('M', fill_method='ffill', how='last')
Out[21]:
2010-03-31 0
2010-04-30 NaN
2010-05-31 NaN
2010-06-30 1
2010-07-31 NaN
2010-08-31 NaN
2010-09-30 2
2010-10-31 NaN
2010-11-30 NaN
2010-12-31 3
2011-01-31 NaN
2011-02-28 NaN
2011-03-31 4
2011-04-30 NaN
2011-05-31 NaN
2011-06-30 5
2011-07-31 NaN
2011-08-31 NaN
2011-09-30 6
2011-10-31 NaN
2011-11-30 NaN
2011-12-31 7
2012-01-31 NaN
2012-02-29 NaN
2012-03-31 8
Freq: M