Complete the code to rank the values in the 'score' column of the DataFrame.
df['rank'] = df['score'].[1]()
The rank() method assigns ranks to values in a column.
Complete the code to rank the 'score' column with method 'min' to assign the minimum rank to ties.
df['rank_min'] = df['score'].rank(method=[1])
The method='min' assigns the minimum rank to tied values.
Fix the error in the code to rank the 'score' column in descending order.
df['rank_desc'] = df['score'].rank(ascending=[1])
To rank in descending order, set ascending=False as a boolean, not a string.
Fill both blanks to create a dictionary comprehension that maps words to their ranks if their length is greater than 3.
{word: df['score'].rank(method=[1])[i] for i, word in enumerate(words) if len(word) [2] 3}The method='average' assigns average ranks, and the condition len(word) > 3 filters words longer than 3 letters.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their ranks where rank is greater than 2.
{word[1]: df['score'].rank(method=[2])[i] for i, word in enumerate(words) if df['score'].rank(method=[3])[i] > 2}The first blank uses .upper() to uppercase words. The ranking methods are 'average' for the key and 'min' for the condition.