Check out Building a Data-Centric Culture at the ALMA Observatory on November 5th Read More

write_with_schema including Index to output

Level 1
write_with_schema including Index to output
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
0 Kudos
2 Replies
Dataiker
Dataiker
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
0 Kudos
Level 1

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.

0 Kudos
Labels (1)