I am working with intraday stock data that i have downloaded to a CSV file. The data contains the stock price for MO per minute. In order to generate a time-frame for the data, i use the pandas function:
pd.timedelta_range('1 days 9 hours 30 minutes', periods=len(df), freq='min')
To add the two dataframes togehter, i use the following
time = pd.DataFrame(data = df,index=pd.timedelta_range('1 days 9 hours 30 minutes', periods=len(df), freq='min'))
It results in this
MO
1 days 09:30:00 NaN
1 days 09:31:00 NaN
1 days 09:32:00 NaN
1 days 09:33:00 NaN
1 days 09:34:00 NaN
Not sure why i am getting NaN values for the stock data.
Raw data (df) looks like this:
MO
65.67
65.74
66.064
65.99
65.8801
65.87
65.89
65.9
65.73
65.67
...
...