I’ve just created a new dataframe, that is a subset of a larger one. (image link below)
However, it is making the first column and index, which I do not want.
I’ve tried looking for answers, but everything seems to relate to resetting and index
I either want to add a column that will serve as a new index (just numbered would be fine), or just change this column so its no longer an index
>Solution :
You can try this:
# keep the index as a column
df = df.reset_index()
# drop it
df = df.reset_index(drop=True)