Complete the code to sort the DataFrame by the 'score' column in ascending order.
sorted_df = df.sort_values(by=[1])We sort the DataFrame by the 'score' column to organize data based on scores.
Complete the code to rank the 'score' column in descending order (highest score gets rank 1).
df['rank'] = df['score'].rank(ascending=[1])
Setting ascending=False ranks highest scores as 1, which is typical for ranking.
Fix the error in the code to sort the DataFrame by 'age' in descending order.
sorted_df = df.sort_values(by='age', [1]=False)
The correct parameter name is 'ascending' to specify sort order.
Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.
{word: [1] for word in words if [2]The dictionary maps each word to its length (len(word)) only if the length is greater than 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their scores only if score is above 50.
{ [1]: [2] for word, score in data.items() if [3] }The dictionary keys are uppercase words, values are scores, filtered by scores above 50.