I am exploring bike share data.
I combined two tables: one containing bike share data and the other containing weather data. The 'Date Start' column is in the bike share data. The 'date' column is in the weather data.
I would like to group the count of ID for each hour, so I can see the effect of weather on bike usage.
| ID | Start | End | Date Start | Duration | date | rain | temp | wdsp |
|---|---|---|---|---|---|---|---|---|
| 1754125 | Eyre Square South | Glenina | 01 Jan 2019 00:17 | 00:15:02 | 01-jan-2019 00:00 | 0.0 | 9.9 | 4.0 |
| 1754170 | Brown Doorway | University Hospital Galway | 01 Jan 2019 07:55 | 00:04:57 | 01-jan-2019 01:00 | 0.0 | 9.3 | 4.0 |
| 1754209 | New Dock Street | New Dock Street | 01 Jan 2019 11:42 | 02:57:57 | 01-jan-2019 02:00 | 0.0 | 9.2 | 5.0 |
| 1754211 | Claddagh Basin | Merchants Gate | 01 Jan 2019 11:50 | 00:02:43 | 01-jan-2019 03:00 | 0.0 | 9.1 | 5.0 |
I have tried:
data.groupby(['date','ID']).size()
data.groupby(['date','ID']).size().reset_index(name='counts')
But I don't really know what I'm doing. Any help would be appreciated.