Challenge - 5 Problems
Dataset Loading Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of loading a CSV with pandas
What is the output of the following code snippet when loading a CSV file with pandas and printing the first 3 rows?
ML Python
import pandas as pd from io import StringIO csv_data = '''name,age,score Alice,30,85 Bob,25,90 Charlie,35,88 David,40,92''' df = pd.read_csv(StringIO(csv_data)) print(df.head(3))
Attempts:
2 left
❓ Model Choice
intermediate2:00remaining
Choosing dataset loading method for built-in datasets
You want to load the Iris dataset for a classification task using scikit-learn. Which code snippet correctly loads the dataset as a dictionary with data and target arrays?
Attempts:
2 left
❓ Metrics
advanced2:00remaining
Evaluating dataset loading time
You load a large CSV dataset using pandas with and without specifying dtypes. Which statement about loading time and memory usage is true?
Attempts:
2 left
🔧 Debug
advanced2:00remaining
Identifying error when loading CSV with missing header
What error will the following code raise when loading a CSV file without a header row using pandas without specifying header=null?
ML Python
import pandas as pd from io import StringIO csv_data = '''Alice,30,85 Bob,25,90 Charlie,35,88''' df = pd.read_csv(StringIO(csv_data)) print(df.head())
Attempts:
2 left
🧠 Conceptual
expert2:00remaining
Understanding dataset loading with train_test_split
You load a built-in dataset and split it into training and testing sets using scikit-learn's train_test_split. Which statement is true about the resulting datasets?
Attempts:
2 left