I often came across this problem. If you have an existing DataFrame in Pandas and you want to add a row that just increments the score, i.e. 0, 1, 2 ... what is the most efficient way to do this?
Thank!
Sam
The easiest way -
df = df.reset_index()
This will give you a new index starting at 0.
You can also do
df['counter'] = range(len(df))