以下是我的数据的一小部分示例。我在某些时候有一些值,标记为A,我想在某些时候与价格相关联,标记为B.
每个A值考虑到相应时间之前的间隔。值0.054873437864689699是从午夜到651.0分钟(或10:51 am)。值0.055546509015723597为651.0至653.0分钟(或上午10:51至上午10:53),依此类推。
每个B值是在精确到毫秒的相应时间的价格。我可以简单地平均一段时间内的价格,以便将时间与A值相匹配。
我在Pandas文档中找到了“rolling_corr_pairwise”。我是Pandas的新手,需要一个超级简化的,逐步解释如何实现它。制作DataFrame对我来说也是新手。我想找到并绘制A和B值与时间的滚动相关性,例如50分钟的窗口。我意识到列出时间的方式(从午夜开始的几分钟)很糟糕,所以谢谢你对我的支持。
[0.054873437864689699,0.055546509015723597,0.056806870789744064,0.05656315835834981,0.056307375921714732,0.056614971519205935,0.058407075702340799,0.058483089024092987,0.059124318881877719,0.057917622539541552,0.058499741855677162,0.059480023024158751,0.059925414031410718,0.059699384112206717,0.059783470585893353,0.058500193498812712,0.056660594185120206,0.057215267146834899,0.054616609322569204,0.053707026223574213,0.053727363037656489,0.052396419451433848,0.051417634891722949, 0.050305835255857634,0.050611614412277413,0.050005571241158321,0.051123891272704211,0.049674112051554621,0.049446781886845974,0.047887309892200268]
[651.0,653.0,656.0,657.0,658.0,661.0,663.0,665.0,666.0,668.0,671.0,673.0,674.0,675.0,676.0,677.0,679.0,680.0,682.0,683.0,684.0,686.0,687.0, 689.0,691.0,693.0,696.0,700.0,701.0,704.0]
[116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.32,116.32,116.32,116.32,116.32,116.32,116.33,116.33, 116.33,116.33,116.33,116.33,116.3201,116.33,116.33,116.33,116.3201,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33,116.33, 116.33,116.33]
[629.5010833333333,629.5010833333333,629.5013166666666,629.5013166666666,629.5013166666666,629.5018166666666,629.5047,629.507,629.5070666666667,629.5071166666667,629.508,629.508,629.508,629.508,629.508,629.5080333333333,629.5080666666667,629.5080666666667,629.5080666666667,629.5080666666667,629.5080666666667,629.5081,629.5081833333334, 629.5081833333334,629.5082166666666,629.50865,629.50865,629.5087166666667,629.5093166666667,629.5098333333333,629.5195,629.5197,629.5240166666666,629.5316333333333,629.5316666666666,629.5316666666666,629.5316666666666,629.5316666666666,629.5316666666666,629.5316666666666,629.5317666666666,629.5317666666666,629.5317666666666,629.5317666666666,629.5317666666666,629.5317666666666,629.5320333333333,629.5325, 629.5325333333333,629.5365833333333]