below is my df
import pandas as pd
df = pd.DataFrame({'Date' : ['2014-03-27', '2014-03-28', '2014-03-31', '2014-04-01', '2014-04-02', '2014-04-03', '2014-04-04', '2014-04-07','2014-04-08', '2014-04-09'],
})
I can create a column with another date which is two months prior to the date on the row.
df['Date1'] = df.Date.apply(lambda x: pd.to_datetime(x) + relativedelta(months=-2))
is there a much faster way to perform that same task (vectorization for instance)?my original df is really huge 30-40k rows.