0
0
SciPydata~10 mins

SciPy vs NumPy relationship - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import NumPy with its common alias.

SciPy
import [1] as np
Drag options to blanks, or click blank then click option'
Anumpy
Bmatplotlib
Cpandas
Dscipy
Attempts:
3 left
💡 Hint
Common Mistakes
Importing SciPy instead of NumPy.
Using an incorrect alias.
2fill in blank
medium

Complete the code to import SciPy's stats module.

SciPy
from scipy import [1]
Drag options to blanks, or click blank then click option'
Aoptimize
Bintegrate
Cstats
Dcluster
Attempts:
3 left
💡 Hint
Common Mistakes
Importing the wrong SciPy submodule.
Confusing SciPy submodules with NumPy functions.
3fill in blank
hard

Fix the error in the code to create a NumPy array.

SciPy
arr = np.[1]([1, 2, 3, 4])
Drag options to blanks, or click blank then click option'
Alist
Barray
Cmatrix
Darraylist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' which is a Python type, not a NumPy function.
Using 'matrix' which is a different NumPy type.
4fill in blank
hard

Fill both blanks to create a SciPy normal distribution and calculate its mean.

SciPy
dist = scipy.stats.[1](loc=0, scale=1)
mean_value = dist.[2]()
Drag options to blanks, or click blank then click option'
Anorm
Bmean
Cmedian
Dmode
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'median' or 'mode' instead of 'mean' to get the average.
Using a wrong distribution name.
5fill in blank
hard

Fill all three blanks to create a NumPy array, calculate its mean, and then use SciPy to perform a t-test.

SciPy
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)
Drag options to blanks, or click blank then click option'
Aarray
Bmean
Cttest_1samp
Dmedian
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'median' instead of 'mean' for average.
Using wrong SciPy test functions.
Not importing SciPy stats module.