计算滚动相关性得到的值远大于1

2024-09-28 05:22:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图计算How to calculate Rolling Correlation with pandas?之后的滚动窗口相关性。我有一个dataset,有两列和一个datetime索引

+---------------------+---------------------+---------------------+
|                     |   temperature_pair1 |   temperature_pair2 |
|---------------------+---------------------+---------------------|
| 2019-04-16 09:06:00 |               22.69 |               22.69 |
| 2019-04-16 09:07:00 |               22.69 |               22.69 |
| 2019-04-16 09:08:00 |               22.69 |               22.69 |
| 2019-04-16 09:09:00 |               22.75 |               22.69 |
| 2019-04-16 09:10:00 |               22.69 |               22.69 |
| 2019-04-16 09:11:00 |               22.69 |               22.75 |
| 2019-04-16 09:12:00 |               22.75 |               22.75 |
| 2019-04-16 09:13:00 |               22.75 |               22.75 |
| 2019-04-16 09:14:00 |               22.75 |               22.75 |
| 2019-04-16 09:15:00 |               22.75 |               22.75 |
+---------------------+---------------------+---------------------+

我正在应用问题foi.temperature_pair1.rolling(window_size).corr(foi.temperature_pair2)中显示的相同方法,但结果数据帧的值为outside of the range{}。我到底错过了什么


Tags: topandasdatetimewithwindowdatasethowcalculate

热门问题