I am ranking a bunch of movies using pandas, from 1-100, and I was wondering how to create a separate column called score where the scores are inverse. for example:
rank score
- 100
- 99
- 98
all the way to
- 1
thank you!
CodePudding user response:
if already you have rank column with the values 1 to 100,
df['rank'] = range(1, 101)
df['score'] = range(len(df),0,-1)