Complete the code to import NumPy with its common alias.
import [1] as np
NumPy is imported using the alias np to simplify code.
Complete the code to import SciPy's stats module.
from scipy import [1]
The stats module in SciPy provides statistical functions.
Fix the error in the code to create a NumPy array.
arr = np.[1]([1, 2, 3, 4])
The correct function to create a NumPy array is array.
Fill both blanks to create a SciPy normal distribution and calculate its mean.
dist = scipy.stats.[1](loc=0, scale=1) mean_value = dist.[2]()
The normal distribution in SciPy is norm, and its mean is found with mean().
Fill all three blanks to create a NumPy array, calculate its mean, and then use SciPy to perform a t-test.
import numpy as np from scipy import stats arr = np.[1]([10, 20, 30, 40, 50]) mean_val = np.[2](arr) t_stat, p_val = stats.[3](arr, popmean=30)
We create a NumPy array with array, calculate the mean with mean, and perform a one-sample t-test with SciPy's ttest_1samp.
