Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to load data from a CSV file using pandas.
ML Python
import pandas as pd data = pd.[1]('data.csv')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
2fill in blank
mediumComplete the code to remove rows with missing values from the DataFrame.
ML Python
clean_data = data.[1]() Drag options to blanks, or click blank then click option'
Attempts:
3 left
3fill in blank
hardFix the error in the code to convert a categorical column to numeric using one-hot encoding.
ML Python
encoded_data = pd.get_dummies(data, columns=[[1]]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
4fill in blank
hardFill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.
ML Python
{word: [1] for word in words if [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
5fill in blank
hardFill all three blanks to create a dictionary comprehension that includes only items with value greater than 0 and keys in uppercase.
ML Python
{ [1]: [2] for [3], v in data.items() if v > 0 } Drag options to blanks, or click blank then click option'
Attempts:
3 left