Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by www.statology.org #
 
PREVIOUS NEXT
Tagged: #The #code #shows #reset #index #DataFrame #drop #index
ADD COMMENT
Topic
Name
9+6 =