I have a dataframe that has an index of date type and contains hourly data per day. I need to take only the rows which have the last record of the day and filter out REST OF THE RECORDS FOR THAT DAY ONLY... and do the same for other days.
COL-A
DATE
2014-01-01 00:56:00 NaN
2014-01-01 01:56:00 NaN
2014-01-01 02:56:00 NaN
2014-01-01 03:56:00 NaN
2014-01-01 04:00:00 NaN
2014-01-01 04:56:00 42.0
2014-01-01 05:56:00 NaN
2014-01-01 06:56:00 NaN
2014-01-01 07:56:00 NaN
2014-01-01 08:56:00 NaN
2014-01-01 09:56:00 NaN
2014-01-01 10:00:00 19.0
2014-01-01 10:56:00 NaN
2014-01-01 11:56:00 NaN
2014-01-01 12:56:00 NaN
2014-01-01 13:56:00 NaN
2014-01-01 14:56:00 NaN
2014-01-01 15:56:00 NaN
2014-01-01 16:00:00 NaN
2014-01-01 16:56:00 36.0
2014-01-01 17:56:00 NaN
2014-01-01 18:56:00 NaN
2014-01-01 19:56:00 NaN
2014-01-01 20:56:00 NaN
2014-01-01 21:56:00 NaN
2014-01-01 22:00:00 NaN
2014-01-01 22:56:00 NaN
2014-01-01 23:56:00 NaN
2014-01-01 23:59:00 41.0
2014-01-02 00:56:00 NaN
...
...
...
I need to keep only the row
2014-01-01 23:59:00 41.0
df.resample('D').last()