Challenge - 5 Problems
DataFrame Info Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the shape of the DataFrame?
Given the following DataFrame, what will be the output of
df.shape?Data Analysis Python
import pandas as pd data = {'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35], 'City': ['NY', 'LA', 'SF']} df = pd.DataFrame(data) print(df.shape)
Attempts:
2 left
💡 Hint
Shape shows (rows, columns). Count rows and columns in the data.
✗ Incorrect
The DataFrame has 3 rows and 3 columns, so shape is (3, 3).
❓ Predict Output
intermediate2:00remaining
What are the data types of each column?
What will be the output of
df.dtypes for this DataFrame?Data Analysis Python
import pandas as pd data = {'Name': ['Alice', 'Bob'], 'Age': [25, 30], 'Height': [5.5, 6.0]} df = pd.DataFrame(data) print(df.dtypes)
Attempts:
2 left
💡 Hint
Names are text, ages are whole numbers, heights are decimals.
✗ Incorrect
Name column has text values so type is object, Age is integer, Height is float.
❓ data_output
advanced3:00remaining
What does describe() show for numeric columns?
Given this DataFrame, what will
df.describe() output?Data Analysis Python
import pandas as pd data = {'Score': [80, 90, 100, 70, 85], 'Attempts': [1, 2, 1, 3, 2]} df = pd.DataFrame(data) print(df.describe())
Attempts:
2 left
💡 Hint
Check the mean and standard deviation carefully.
✗ Incorrect
The mean of Score is 85, Attempts mean is 1.8. Standard deviation and quartiles match option D.
🧠 Conceptual
advanced1:30remaining
Which statement about DataFrame dtypes is true?
Consider a DataFrame with columns of different types. Which statement is correct about
df.dtypes?Attempts:
2 left
💡 Hint
Think about what you want to know about each column's type.
✗ Incorrect
df.dtypes returns a Series indexed by column names with their data types as values.
🔧 Debug
expert2:30remaining
Why does this describe() call miss some columns?
Given this DataFrame, why does
df.describe() only show one column?Data Analysis Python
import pandas as pd import numpy as np data = {'A': [1, 2, 3], 'B': ['x', 'y', 'z'], 'C': [np.nan, np.nan, np.nan]} df = pd.DataFrame(data) print(df.describe())
Attempts:
2 left
💡 Hint
Check pandas describe default behavior with non-numeric columns.
✗ Incorrect
By default, describe() summarizes only numeric columns. Non-numeric columns are excluded unless specified.