Please see images -
After creating a dataframe, I use groupby, then I reset the index column only to find that the column for 'county' is still unseen by the dataframe. Please help to rectify.
Please see images -
After creating a dataframe, I use groupby, then I reset the index column only to find that the column for 'county' is still unseen by the dataframe. Please help to rectify.
The df.reset_index()
by default is not an "inplace" operation. But with use of the inplace
parameter you can make it behave as such.
inplace=True
-mydf.reset_index(inplace=True)
df
into another (or the same) variable -mydf = mydf.reset_index()
This should fix your issue.