Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python &引用;“爆炸”;(或重新采样)具有间隔索引的数据帧/序列_Python_Pandas - Fatal编程技术网

Python &引用;“爆炸”;(或重新采样)具有间隔索引的数据帧/序列

Python &引用;“爆炸”;(或重新采样)具有间隔索引的数据帧/序列,python,pandas,Python,Pandas,我有一个IntervalIndex系列 | | sq | |:-------------------------------------------|-------:| | (2020-02-03 09:40:00, 2020-02-03 9:50:00] | 286747 | | (2020-02-03 10:55:00, 2020-02-03 11:10:00] | 617961 | | (202

我有一个IntervalIndex系列

|                                            |     sq |
|:-------------------------------------------|-------:|
| (2020-02-03 09:40:00, 2020-02-03 9:50:00]  | 286747 |
| (2020-02-03 10:55:00, 2020-02-03 11:10:00] | 617961 |
| (2020-02-03 11:05:00, 2020-02-03 11:20:00] | 471782 |
我想把它分解成5分钟的间隔(重叠),就像我在常规日期/时间索引上使用重采样一样。预期结果:

|                                            |     sq |
|:-------------------------------------------|-------:|
| (2020-02-03 09:40:00, 2020-02-03 9:45:00]  | 286747 |
| (2020-02-03 09:45:00, 2020-02-03 9:50:00]  | 286747 |
| (2020-02-03 10:55:00, 2020-02-03 11:00:00] | 617961 |
| (2020-02-03 11:00:00, 2020-02-03 11:05:00] | 617961 |
| (2020-02-03 10:05:00, 2020-02-03 11:10:00] | 617961 |
| (2020-02-03 11:05:00, 2020-02-03 11:10:00] | 471782 |
| (2020-02-03 11:10:00, 2020-02-03 11:15:00] | 471782 |
| (2020-02-03 11:15:00, 2020-02-03 11:20:00] | 471782 |

有几种方法可以做与此问题类似的事情: