-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
Description
Use case: I would like to be able to rollback a datetime Series or Index, mapping each value to the first day of each month.
I suppose this will probably need Cython to be fast.
Example:
import pandas as pd
dates = pd.date_range('2000-01-01', periods=100)
offset = pd.tseries.offsets.MonthBegin()
print dates - offset # this works, but is wrong for the first day of each month
print pd.Index([offset.rollback(d) for d in dates]) # this works correctly but slowly
print offset.rollback(dates) # this should, but doesn't