0
0
Data Analysis Pythondata~20 mins

Essential libraries overview (Pandas, NumPy, Matplotlib) in Data Analysis Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Essential Libraries Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this NumPy array operation?
Consider the following code that uses NumPy to create and manipulate arrays. What will be printed?
Data Analysis Python
import numpy as np
arr = np.array([1, 2, 3, 4])
result = arr * 2 + 1
print(result)
A[3 5 7 9]
B[2 4 6 8]
C[1 2 3 4]
D[4 6 8 10]
Attempts:
2 left
💡 Hint
Remember that NumPy applies operations element-wise on arrays.
data_output
intermediate
2:00remaining
What does this Pandas DataFrame look like after filtering?
Given this DataFrame, what rows remain after filtering for values greater than 50 in column 'B'?
Data Analysis Python
import pandas as pd
df = pd.DataFrame({'A': [10, 20, 30, 40], 'B': [45, 55, 65, 35]})
filtered_df = df[df['B'] > 50]
print(filtered_df)
A
   A   B
1  20  55
2  30  65
B
   A   B
0  10  45
3  40  35
C
   A   B
1  20  55
3  40  35
D
   A   B
0  10  45
2  30  65
Attempts:
2 left
💡 Hint
Look for rows where column 'B' has values strictly greater than 50.
visualization
advanced
2:00remaining
What kind of plot does this Matplotlib code produce?
Look at this Matplotlib code. What type of plot will it create?
Data Analysis Python
import matplotlib.pyplot as plt
x = [1, 2, 3, 4]
y = [10, 20, 25, 30]
plt.bar(x, y)
plt.show()
AA pie chart showing proportions of values 10, 20, 25, 30
BA line plot connecting points (1,10), (2,20), (3,25), (4,30)
CA bar chart with bars at positions 1 to 4 and heights 10, 20, 25, 30
DA scatter plot with points at (1,10), (2,20), (3,25), (4,30)
Attempts:
2 left
💡 Hint
The function plt.bar creates vertical bars.
🧠 Conceptual
advanced
1:30remaining
Which library is best suited for fast numerical operations on arrays?
You want to perform fast mathematical operations on large arrays of numbers. Which library is designed specifically for this?
ASeaborn
BMatplotlib
CPandas
DNumPy
Attempts:
2 left
💡 Hint
Think about which library provides efficient array objects and math functions.
🔧 Debug
expert
2:00remaining
What error does this Pandas code raise?
This code tries to select a column from a DataFrame but causes an error. What error is raised?
Data Analysis Python
import pandas as pd
df = pd.DataFrame({'X': [1, 2], 'Y': [3, 4]})
print(df['Z'])
ATypeError
BKeyError
CValueError
DAttributeError
Attempts:
2 left
💡 Hint
The column 'Z' does not exist in the DataFrame.