Last Updated: December 6, 2025
31 quizzes
Create a NumPy array of 10 zeros for initializing a weight vector
weights = np.((10,))Click an option to fill the blank:
Select the second column from a 2D NumPy array for further analysis
second_column = matrix[:, ]Click an option to fill the blank:
Calculate the mean of all values in a NumPy array of daily temperatures
avg_temp = np.(temperatures)Click an option to fill the blank:
Which statement best describes a key advantage of NumPy over Python lists for numerical data?
Given arr = np.array([[1, 2, 3], [4, 5, 6]]), what is arr.shape?
You have a large numeric dataset in a CSV file. Which Pandas function is typically used to load it into a DataFrame?
In a Pandas DataFrame df, which syntax selects the 'age' column as a Series?
Which Matplotlib function displays the plot window after creating a figure?
Which plot type is most appropriate to compare total sales across product categories?
Given this DataFrame: df, which expression filters rows where 'Revenue' is greater than 1000?
What does the axis=0 argument mean in np.mean(data, axis=0) for a 2D array?
Which DataFrame method is commonly used to compute summary statistics like mean and std for numeric columns?
You want to color bars differently for each category in a Matplotlib bar chart. Which parameter should you use?
Which Pandas method combines rows from two DataFrames based on a common key column (like a database join)?
Order the steps to load a CSV file into a Pandas DataFrame and plot a line chart of a 'sales' column over 'day'.
Drag and drop to reorder, or use the arrows.
Order the steps to compute the average rating per product using a Pandas DataFrame and a groupby operation.
Drag and drop to reorder, or use the arrows.
What is the output of this NumPy code?
1import numpy as np
2arr = np.array([10, 20, 30, 40])
3print(arr[1] + arr[-1])What is the output of this Pandas code?
1import pandas as pd
2s = pd.Series([3, 5, 7], index=['a', 'b', 'c'])
3print(s['b'])What does this code print?
1import numpy as np
2m = np.array([[1, 2], [3, 4]])
3print(m.reshape((4,))[2])What is the output of this Matplotlib-related code?
1import matplotlib.pyplot as plt
2values = [1, 2, 3]
3plt.plot(values)
4print(len(values))What is the output of this Pandas DataFrame code?
1import pandas as pd
2data = {'A': [1, 2], 'B': [3, 4]}
3df = pd.DataFrame(data)
4print(df['A'].mean())Find the bug in this NumPy code that normalizes a vector of features.
Click on the line(s) that contain the bug.
import numpy as np def normalize_vector(features): total = np.sum(features) normalized = features / total return normalizedFind the bug in this Pandas code that filters high-value transactions.
Click on the line(s) that contain the bug.
import pandas as pd def filter_high_value(df_transactions): condition = df_transactions['amount'] > 1000 result = df_transactions.loc[condition, 'amount', 'customer_id'] return resultMatch the NumPy function to what it creates or computes.
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Match the visualization type to the most suitable use case.
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Complete the code to create a NumPy array of 100 evenly spaced values between 0 and 1 and compute their average.
import numpy as npvalues = np.(0, 1, 100)mean_value = np.(values)print(mean_value)Click an option to fill blank 1:
Complete the code to read a CSV file into a DataFrame and show the first 3 rows.
import pandas as pdsales_df = pd.('sales.csv')preview = sales_df.(3)print(preview)Click an option to fill blank 1:
Complete the code to filter rows where 'Profit' is positive and compute the average profit.
import pandas as pdpositive = df[df['Profit'] > 0]avg_profit = positive['Profit'].()print()Click an option to fill blank 1:
Complete the code to create a bar chart of product sales using Matplotlib.
import matplotlib.pyplot as pltproducts = ['A', 'B', 'C']sales = [120, 150, 90]plt.(products, sales, color='skyblue')plt.('Product Sales')plt.show()Click an option to fill blank 1:
Click the line that sets the x-axis label in this Matplotlib plot.
Click on the line to select.
import matplotlib.pyplot as pltx = [1, 2, 3]y = [2, 4, 6]plt.plot(x, y)plt.xlabel('Time (days)')plt.ylabel('Value')plt.title('Trend over time')plt.show()Click the line that performs the grouping operation in this Pandas code.
Click on the line to select.
import pandas as pd sales = pd.read_csv('sales.csv')by_region = sales.groupby('region')summary = by_region['revenue'].sum()print(summary)