0
0
ML Pythonprogramming~10 mins

Why data preparation consumes most ML time in ML Python - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete 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'
Aimport_csv
Bload_csv
Copen_csv
Dread_csv
Attempts:
3 left
2fill in blank
medium

Complete 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'
Afillna
Bremove_na
Cdropna
Dclean_na
Attempts:
3 left
3fill in blank
hard

Fix 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'
Acategory_col
B'category_col'
C'category_cols'
Dcategory_cols
Attempts:
3 left
4fill in blank
hard

Fill 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'
Alen(word)
Blen(word) > 3
Cword
Dword > 3
Attempts:
3 left
5fill in blank
hard

Fill 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'
Ak.upper()
Bv
Ck
Dv.upper()
Attempts:
3 left