reset_index pandas
df.reset_index(drop=True, inplace=True)
reset_index pandas
df.reset_index(drop=True, inplace=True)
The following code shows how to reset the index of the DataFrame and drop the old index completely:
#reset index
df.reset_index(drop=True, inplace=True)
#view updated DataFrame
print(df)
points assists rebounds
0 25 5 11
1 12 7 8
2 15 7 10
3 14 9 6
4 19 12 6
5 23 9 5
6 25 9 9
7 29 4 12
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us