I am trying to figure out how to do this in Pandas and still have zero luck.
My data frame looks like this:
A B C D
time
2013-07-19 14:54:03 1354.85 92.20 1453.44 7746.56
2013-07-19 14:56:02 1348.30 44.60 1399.83 7800.17
2013-07-19 14:58:02 1285.76 33.93 1325.31 7874.69
...
2013-12-16 14:24:02 1114.74 136.59 1254.04 7945.96
2013-12-16 14:26:03 1180.76 65.39 1248.59 7951.41
2013-12-16 14:28:03 1015.98 126.96 1147.68 8052.32
This data is updated very often, and I would like to be able to select all the values ββfor the last 24 hours or last week or last month, etc.
My current workaround is to pull data from the database using a query like this:
24_hour_data = ('select time, A, B, C, D from \
agg where time >= datetime(\'now\', \'-24 Hours\', \'localtime\')')
Thanks.
source
share