1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| import pandas as pd import datetime df = pd.DataFrame([datetime.datetime(2020, 8, 12, 0, 0), datetime.datetime(2020, 8, 24, 0, 0), datetime.datetime(2020, 8, 5, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 24, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 23, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0), datetime.datetime(2020, 8, 19, 0, 0)],columns=['date']) print(df) print(df[df['date']>datetime.datetime(2020,8,19,0,0,0)])
|