{"id":4225,"date":"2021-04-27T19:38:14","date_gmt":"2021-04-27T14:08:14","guid":{"rendered":"https:\/\/python-programs.com\/?p=4225"},"modified":"2021-11-22T18:43:02","modified_gmt":"2021-11-22T13:13:02","slug":"pandas-convert-data-frame-index-into-column-using-dataframe-reset_index-in-python","status":"publish","type":"post","link":"https:\/\/python-programs.com\/pandas-convert-data-frame-index-into-column-using-dataframe-reset_index-in-python\/","title":{"rendered":"Pandas : Convert Data frame index into column using dataframe.reset_index() in python"},"content":{"rendered":"

In this article, we will be exploring ways to convert indexes of a data frame or a multi-index data frame into its a column.<\/p>\n

There is a function provided in the Pandas Data frame class to reset the indexes of the data frame.<\/p>\n

Dataframe.reset_index()<\/h2>\n
DataFrame.<\/span>reset_index<\/span>(<\/span>self, level=<\/span>None<\/span>, drop=<\/span>False<\/span>, inplace=<\/span>False<\/span>, col_level=<\/span>0<\/span>, col_fill=<\/span>''<\/span>)<\/span><\/pre>\n

It returns a data frame with the new index after resetting the indexes of the data frame.<\/p>\n