i have a dataframe downloading as:
the dataframe with the date header on a separate row
if i export it to a csv file and import it again it has all the headers on the first row.
if i look for the information from the row via .iloc[0] i get:
bidopen 1.14140
bidclose 1.14143
bidhigh 1.14160
bidlow 1.14116
askopen 1.14153
askclose 1.14164
askhigh 1.14179
asklow 1.14127
tickqty 5204.00000
Name: 2022-01-14 21:00:00, dtype: float64
resetting the index does not work
essentially i am trying to be able to select the date column, i.e. df['date'] etc, but with no luck in its current form.
any help would be greatly appreciated.
CodePudding user response:
This code will let you switch the date as a columns and reset your index. You will need to import pandas
df['Date'] = df.index
df.reset_index(drop=True, inplace=True)
