-1

Stack Overflow NBA Stats Dataframe Screenshot

The bold lines are the important ones. I'm trying to change the number in the output from 23 to 17, and I've already used reset_index to create the index on the left side. Now I just need the .index command to match the index listed on the left so that the index notes that the Detroit Pistons were 17th in scoring in the 2004 NBA season. Any ideas?

Edit: So as a reproducible example, if I had a dataframe

d = {'col1': [100,79,150,105], 'col2': [10,9,8,7]}
df = pd.Dataframe(data = d)
'''

1 Answers1

0

Try something like

df.iloc[17, 0]= 17
Stefan
  • 1,697
  • 15
  • 31