write_with_schema including Index to output
dataiku_user
Registered Posts: 7 ✭✭✭✭
I need to write a pandas dataframe to dataiku output, with the index values. However the write_with_schema doesn't write out the index values
Tagged:
Answers
-
Hi,
Before using the `write_with_schema` method, you can put
df["index_col"] = df.index
Then your pandas data frame will have an actual "index_col" column written.
Cheers,
Alex -
I had the same issue.
Just add .reset_index() at the end of your dataframe or add df = df.reset_index() before you write your dataset.