mongo db query interval error timegrouper
df1 = pd.DataFrame(list(collection.find()))
print(df1)
df = df1.set_index('datetime').groupby([pd.TimeGrouper('6M'),'actual'])



----------------------------------------------------------------------------------------------------
                          _id junc_id        topic group_traffic  group_traffic_value  ...  actual         route car_count      timestamp            datetime
0    5def4bb5e3ef47a7eba96d83     483  CBJ-008-DYN           G_1                    0  ...      32  Jalan A to B         0  1575963573257 2019-12-10 15:39:33
1    5def4bd4e3ef47a7eba96d84     483  CBJ-008-DYN           G_2                    0  ...      23  Jalan B to A         0  1575963604584 2019-12-10 15:40:04
2    5def4bebe3ef47a7eba96d85     483  CBJ-008-DYN           G_3                    0  ...      15  Jalan C to D         0  1575963627606 2019-12-10 15:40:27
3    5def4c02e3ef47a7eba96d86     483  CBJ-008-DYN           G_4                    0  ...      14  Jalan C to D         0  1575963650601 2019-12-10 15:40:50
4    5def4c24e3ef47a7eba96d87     483  CBJ-008-DYN          G_11                    0  ...      20  Jalan C to D         0  1575963684117 2019-12-10 15:41:24
..                        ...     ...          ...           ...                  ...  ...     ...           ...       ...            ...                 ...
924  5defeeccdf01769083118ca5     483  CBJ-008-DYN           G_4                    0  ...      10  Jalan D to C         0  1576005324660 2019-12-11 03:15:24
925  5defeee4df01769083118ca6     483  CBJ-008-DYN           G_1                    0  ...      15  Jalan D to C         0  1576005348700 2019-12-11 03:15:48
926  5defeef7df01769083118ca7     483  CBJ-008-DYN           G_2                    0  ...      10  Jalan B to A         0  1576005367530 2019-12-11 03:16:07
927  5defef09df01769083118ca8     483  CBJ-008-DYN           G_3                    0  ...      10  Jalan C to D         0  1576005385297 2019-12-11 03:16:25
928  5defef1cdf01769083118ca9     483  CBJ-008-DYN           G_4                    0  ...      10  Jalan C to D         0  1576005404169 2019-12-11 03:16:44

Traceback (most recent call last):
File "mongo_dash.py", line 38, in
df = df1.set_index('datetime').groupby([pd.TimeGrouper('6M'),'actual'])
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pandas/init.py", line 214, in getattr
raise AttributeError("module 'pandas' has no attribute '{}'".format(name))
AttributeError: module 'pandas' has no attribute 'TimeGrouper'
