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 in pandas is used to load CSV files into a DataFrame.
Complete the code to remove rows with missing values from the DataFrame.
clean_data = data.[1]()fillna which fills missing values instead of removing rows.The dropna() method removes rows with missing values from a DataFrame.
Fix the error in the code to convert a categorical column to numeric using one-hot encoding.
encoded_data = pd.get_dummies(data, columns=[[1]])The column name must be passed as a string inside a list to columns parameter.
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 using len(word). The condition filters words with length greater than 3.
Fill all three blanks to create a dictionary comprehension that includes only items with value greater than 0 and keys in uppercase.
{ [1]: [2] for [3], v in data.items() if v > 0 }The dictionary comprehension converts keys to uppercase with k.upper(), keeps values as v, and iterates over key-value pairs k, v.
