Open ShailuKonda opened 5 years ago
Hello, I hope this will help your problem, did you include level of columns in the argument? For example data.reset_index(level=['A'], inplace = True). Level will select the column.
I hope the link below will help. https://github.com/pandas-dev/pandas/issues/16263
I had the same problem when I use groupby function. The command I used is 'as_index = False'. It will add a new index instead of using the first column as an index.
Try "reset_index", see if that helps. If not, you can take a look on the link below:https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.reset_index.html Or check the code you put in, sometimes anything that is slightly different or a typo may cause the failure, too.
I found some code maybe have the function that you need. Delete row index rearrange: ser.reset_index(drop = True) df.reset_index(drop = True)
Modify the column index directly: df = pd.DataFrame(df,columns = ['One','Two','Three'])
Hope that will help you.
I think you should use reset_index(). In this case, you might miss some parameters. Do check the documentation if you haven't gotten the answer!
S.reset_index(inplace=True,drop=True)
I used a column as an index. I want to remove the column as an index. I used df.reset_index(). It didnt work. Is there any other way i can remove the index .