Complete the code to load survey data from a CSV file into a DataFrame.
import pandas as pd data = pd.[1]('survey_data.csv')
The read_csv function loads CSV files into a DataFrame, which is perfect for survey data stored in CSV format.
Complete the code to calculate the average age from the survey data.
average_age = data['age'].[1]()
The mean() function calculates the average value of the 'age' column.
Fix the error in the code to filter survey responses where satisfaction is greater than 3.
high_satisfaction = data[data['satisfaction'] [1] 3]
To filter rows where satisfaction is greater than 3, use the > operator.
Fill both blanks to create a dictionary of counts for each response in the 'feedback' column where length is more than 10 characters.
feedback_counts = {response: data['feedback'].value_counts()[response] for response in data['feedback'] if len(response) [1] 10 and response [2] ''}We want feedback longer than 10 characters (>) and not empty (!= '') to count meaningful responses.
Fill all three blanks to create a dictionary with keys as uppercase feedback and values as counts for feedback longer than 5 characters.
result = {response[1]: data['feedback'].value_counts()[response] for response in data['feedback'] if len(response) [2] 5 and response [3] ''}We convert feedback to uppercase keys (.upper()), filter length greater than 5 (>), and exclude empty strings (!=).