I have the following code:
import pandas as pd
import numpy as np
df = pd.DataFrame([['red', 1], ['red', 13], ['red', 1], ['blue', 1], ['red', 112], ['blue', 10]])
df.columns = ["colour","rank"]
# df['highest_rank'] = ...
print(df)
"""
colour rank highest_rank
0 red 1 122
1 red 13 122
2 red 1 122
3 blue 1 10
4 red 112 122
5 blue 10 10
"""
Hopefully, the example can show you what I'm trying to do as I'm struggling to describe what I'm wanting - The highest ranking of each colour.