Skip to content Skip to sidebar Skip to footer

Make Column From Pandas Dataframe Index

I have a dataframe where I would like to turn the data in the (first level of the) index into a column. Practically my df looks like this: col1 CoI AK 0 1

Solution 1:

df.reset_index(level=0, inplace=True) should do it. See the docs here.


Post a Comment for "Make Column From Pandas Dataframe Index"