I want to resample a dataframe by date and creating a column based on the aggregate sum of city df:
+-----------------+-------------------+------------+
| booking_date | Cities | province |
+-----------------+-------------------+------------+
| 15-12-17 | Kota Depok | Jawa Barat |
| 15-12-17 | Bogor | Jawa Barat |
| 15-12-17 | Kota Depok | Jawa Barat |
| 15-12-17 | Kota Bandung | Jawa Barat |
| 15-12-17 | Kota Bandung | Jawa Barat |
+-----------------+-------------------+------------+
The output may looks like this:
df:
+-----------------+-------------------+------------+------------+
| booking_date | Cities | province | Count |
+-----------------+-------------------+------------+------------+
| 15-12-17 | Kota Depok | Jawa Barat | 2 |
| 15-12-17 | Bogor | Jawa Barat | 1 |
| 15-12-17 | Kota Bandung | Jawa Barat | 2 |
+-----------------+-------------------+------------+------------+
How to achieve it?