0
0
SciPydata~10 mins

Why hypothesis testing validates claims in SciPy - Test Your Understanding

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

Complete the code to import the function for hypothesis testing from scipy.

SciPy
from scipy.stats import [1]
Drag options to blanks, or click blank then click option'
Amode
Bmean
Cmedian
Dttest_ind
Attempts:
3 left
💡 Hint
Common Mistakes
Using descriptive statistics functions like mean or median instead of a test function.
Importing a function that does not perform hypothesis testing.
2fill in blank
medium

Complete the code to perform a t-test on two sample arrays.

SciPy
stat, p_value = ttest_ind(sample1, [1])
Drag options to blanks, or click blank then click option'
Asample2
Bsample3
Csample1
Dsample4
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the same sample twice.
Passing an unrelated variable.
3fill in blank
hard

Fix the error in the code to correctly check if the p-value is less than 0.05.

SciPy
if p_value [1] 0.05:
    print('Reject the null hypothesis')
Drag options to blanks, or click blank then click option'
A>
B<
C>=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using greater than instead of less than.
Using equality operator which is not appropriate here.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.

SciPy
{word: [1] for word in words if [2] > 3}
Drag options to blanks, or click blank then click option'
Alen(word)
Bword
Dword.length
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself instead of its length as the value.
Using an incorrect attribute like word.length which is not valid in Python.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase words to their counts only if count is greater than 1.

SciPy
{ [1]: [2] for [3], count in word_counts.items() if count > 1 }
Drag options to blanks, or click blank then click option'
Aword.upper()
Bcount
Cword
Dword.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using the original word as key without converting to uppercase.
Mixing up keys and values in the comprehension.