3
給出一個DF:如何正確地擴展熊貓數據框?
Date and Time,Open,High,Low,Close
07/13/2017 15:55,1.1436,1.1436,1.1436,1.1436
07/13/2017 15:56,1.1435,1.1435,1.1435,1.1435
07/13/2017 15:57,1.1434,1.1434,1.1434,1.1434
07/13/2017 15:58,1.1436,1.1436,1.1436,1.1436
07/13/2017 15:59,1.1437,1.1437,1.1437,1.1437
我如何延長指數和填充從最後一排的數值數據框,輸出的結果會是這樣的:
擴展DF 24小時,在1分鐘的頻率:要做到這一點(希望不是唯一的方法)
Date and Time,Open,High,Low,Close
07/13/2017 15:55,1.1436,1.1436,1.1436,1.1436 |
07/13/2017 15:56,1.1435,1.1435,1.1435,1.1435 |
07/13/2017 15:57,1.1434,1.1434,1.1434,1.1434 | --> Existing Data
07/13/2017 15:58,1.1436,1.1436,1.1436,1.1436 |
07/13/2017 15:59,1.1437,1.1437,1.1437,1.1437 |
07/13/2017 16:00,1.1437,1.1437,1.1437,1.1437
07/13/2017 16:02,1.1437,1.1437,1.1437,1.1437
07/13/2017 16:03,1.1437,1.1437,1.1437,1.1437
...
...
...
07/14/2017 15:57,1.1437,1.1437,1.1437,1.1437
07/14/2017 15:58,1.1437,1.1437,1.1437,1.1437
07/14/2017 15:59,1.1437,1.1437,1.1437,1.1437
它不應該以'07/14/2017 15:55'而不是'07/14/2017 15:59'結束嗎? – Abdou
@Abdou我從最後一行算起24小時07/13/2017 15:59 – hernanavella
我明白了。所提供的解決方案非常接近你所追求的目標。 – Abdou