How to properly extend a pandas dataframe?

Viewed 5415

given a 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

How can I extend the index and fill the dataframe with the values from last row, the result output would be something like this:

Extend df 24h, at 1min frequency:

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
1 Answers
Related