Complete the code to load data from a CSV file using pandas.
import pandas as pd data = pd.[1]('data.csv')
The read_csv function loads data from a CSV file into a DataFrame.
Complete the code to display the first 5 rows of the DataFrame.
print(data.[1]())
The head() method shows the first 5 rows of the DataFrame by default.
Fix the error in the code to filter rows where the 'score' column is greater than 50.
filtered = data[data['score'] [1] 50]
To select rows where 'score' is greater than 50, use the '>' operator.
Fill both blanks to create a dictionary comprehension that maps words to their lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if [2]len(words) which is the total number of words, not length of each word.word > 3 which compares a string to a number and causes error.The key is the word, the value is its length using len(word). The condition filters words longer than 3 characters with len(word) > 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their scores if the score is above 70.
result = { [1]: [2] for word, score in data.items() if score [3] 70 }word.lower() instead of uppercase.The dictionary keys are uppercase words using word.upper(). The values are the scores. The filter keeps scores greater than 70.