I have a dataframe with a date column that I update daily. I\'d like to create a copy of it with just the past 30 day\'s of data.
I tried the following syntax based on
Try this:
import datetime import pandas as pd df[df.the_date_column > datetime.datetime.now() - pd.to_timedelta("30day")]
Update: Edited as suggested by Josh.