0
0
Data Analysis Pythondata~10 mins

ANOVA in Data Analysis Python - Interactive Code Practice

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

Complete the code to import the ANOVA function from scipy.stats.

Data Analysis Python
from scipy.stats import [1]
Drag options to blanks, or click blank then click option'
Apearsonr
Bchi2_contingency
Cf_oneway
Dttest_ind
Attempts:
3 left
💡 Hint
Common Mistakes
Importing ttest_ind instead of f_oneway
Using pearsonr which is for correlation
Using chi2_contingency which is for categorical data
2fill in blank
medium

Complete the code to perform one-way ANOVA on three groups: group1, group2, and group3.

Data Analysis Python
stat, p = f_oneway([1], group2, group3)
Drag options to blanks, or click blank then click option'
Adata
Bgroup1
Cgroup4
Dsamples
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable that does not exist like group4
Using the whole dataset instead of individual groups
3fill in blank
hard

Fix the error in the code to correctly perform ANOVA on three groups stored in a list called data_groups.

Data Analysis Python
stat, p = f_oneway(*[1])
Drag options to blanks, or click blank then click option'
Adata_groups
Bdata_groups[0]
Cdata_groups()
Ddata_groups[:]
Attempts:
3 left
💡 Hint
Common Mistakes
Passing only the first group instead of all groups
Calling the list as a function which causes an error
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each group name to its mean value.

Data Analysis Python
group_means = {name: [1] for name, data in [2].items()}
Drag options to blanks, or click blank then click option'
Adata.mean()
Bdata.sum()
Cgroups
Dgroup_data
Attempts:
3 left
💡 Hint
Common Mistakes
Using sum instead of mean
Using the wrong dictionary name
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that includes only groups with mean greater than 50.

Data Analysis Python
filtered_means = {name: mean for name, mean in [1].items() if mean [2] [3]
Drag options to blanks, or click blank then click option'
Agroup_means
B>
C50
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using less than operator instead of greater than
Using the wrong dictionary variable