You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have worked around this by forcing the hour in my monthly data to something past the last minute that I care about in my by-minute data as follows, but this seems incredibly crude:
from dateutil.relativedelta import *
newi = [x + relativedelta(hour=20) for x in ma_pw.index]
ma_pw.index = newi[:]
Then my original reindex works.
Is there a clean way to instruct the reindex method to include the datetime objects having the same datetime.date on that last day of the month?
The text was updated successfully, but these errors were encountered:
You are back-propagating values? hmm. There are two options: pad and backfill. Pad propagates forward, backfill the opposite.
You can do ma_pw.fill(method='pad') method-- please note that fill is going to be renamed to something else in the 0.4 release (which is coming after the yet-unreleased 0.3 release) but should be easy to fix your code ;)
I have a DataFrame with 1 minute timestamps, pw.
I have a monthly average of the values:
ma_pw=pw.groupby(BMonthEnd(+1).rollforward).aggregate(np.mean)
When I do a reindex to push that average back into all of the periods for the month,
the last day's values are NaN. Here's my reindex attempt:
reindexed = ma_pw.reindex(pw.index, method="backfill").
I have worked around this by forcing the hour in my monthly data to something past the last minute that I care about in my by-minute data as follows, but this seems incredibly crude:
from dateutil.relativedelta import *
newi = [x + relativedelta(hour=20) for x in ma_pw.index]
ma_pw.index = newi[:]
Then my original reindex works.
Is there a clean way to instruct the reindex method to include the datetime objects having the same datetime.date on that last day of the month?
The text was updated successfully, but these errors were encountered: