I have data in a csv file that contains the following fields:
- user_id
- date_created
- date_edited
- date_finalised; and
- date_withdrawn
User_id and date_created fields will never contain null values but the other columns invariably will.
An example:
user_id, date_created, date_edited, date_finalised, date_withdrawn
1, 2013-01-31 00:17:01, null, 2013-02-02 14:11:17, null
2, 2013-01-31 01:00:15, 2013-01-31 01:00:30, null, null
I would like end up with a DataFrame containing a count of records for each datetime column that occur within certain date period bins i.e. daily, hourly and minutely
Using the example above and daily frequency I would see:
date, date_created, date_edited, date_finalised, date_withdrawn
2013-01-31, 2, 1, 0, 0
2013-02-01, 0, 0, 0, 0
2013-02-02, 0, 0, 1, 0
After importing the file with
data = pd.read_csv('filename.csv')
What steps are required to achieve this?