How do find correlation between time events and time series data in python?

ぃ、小莉子 提交于 2020-02-16 05:28:30

问题


I have two different excel files. One of them is including time series data (268943 accident time rows) as below

                  Datetime
0      2010-01-01 14:00:00
1      2010-01-01 13:00:00
2      2010-01-01 21:00:00
3      2010-01-01 13:00:00
4      2010-01-01 21:00:00
...                    ...
268938 2018-08-06 11:25:00
268939 2018-08-06 10:30:00
268940 2018-08-06 10:00:00
268941 2018-08-06 11:37:00
268942 2018-08-06 09:00:00

[268943 rows x 1 columns] dtype = datetime64[ns]

The other file is blood sugar level of 14 workers measured daily from 8 to 17 and during 4 months(all data merged in one file) as like below

                Datetime  BSL
0    2019-07-16 07:43:07   82
1    2019-07-16 07:48:07   80
2    2019-07-16 07:53:07   82
3    2019-07-16 07:58:07   82
4    2019-07-16 08:03:07   86
...                  ...  ...
5638 2020-01-25 16:39:07  145
5639 2020-01-25 16:44:07  136
5640 2020-01-25 16:49:07  137
5641 2020-01-25 16:54:07  134
5642 2020-01-25 16:59:07  129

[5643 rows x 2 columns] dtype = datetime64[ns] and BSL: int64

I am trying to understand correlation between accident times and BSL values (hourly from 8 to 17 per one hour and daily from Monday to Friday and monthly)

Which statistical method is fit(Normalized Auto or cross correlation) and how can I do that? Generally, in the questions, the correlation analysis are performed between two time series based values, but I think this is a little bit different. Also, here times are different.

Thank your advance..

来源:https://stackoverflow.com/questions/60182894/how-do-find-correlation-between-time-events-and-time-series-data-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!