0
0
Data Analysis Pythondata~10 mins

Descriptive statistics review 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 calculate the mean of the list 'data'.

Data Analysis Python
mean_value = sum(data) / [1]
Drag options to blanks, or click blank then click option'
Amin(data)
Bsum(data)
Cmax(data)
Dlen(data)
Attempts:
3 left
💡 Hint
Common Mistakes
Dividing by sum(data) instead of the number of elements.
Using max or min instead of the count of elements.
2fill in blank
medium

Complete the code to calculate the median of the sorted list 'data_sorted'.

Data Analysis Python
n = len(data_sorted)
median = (data_sorted[n // 2] if n % 2 != 0 else (data_sorted[n // 2 - 1] + data_sorted[[1]]) / 2)
Drag options to blanks, or click blank then click option'
An // 2
Bn // 2 + 1
Cn // 2 - 1
Dn // 2 - 2
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong index for the second middle element.
Confusing integer division with float division.
3fill in blank
hard

Fix the error in the code to calculate the variance of the list 'data'.

Data Analysis Python
mean = sum(data) / len(data)
variance = sum((x - mean)[1] for x in data) / len(data)
Drag options to blanks, or click blank then click option'
A* 2
B** 2
C^ 2
D* * 2
Attempts:
3 left
💡 Hint
Common Mistakes
Using '^' which is bitwise XOR, not exponentiation.
Using '* 2' which doubles instead of squares.
4fill in blank
hard

Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.

Data Analysis Python
lengths = {word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself as the value instead of its length.
Using '<' instead of '>' in the condition.
5fill in blank
hard

Fill all three blanks to create a dictionary of uppercase words and their lengths for words longer than 4 characters.

Data Analysis Python
result = [1]: [2] for w in words if len(w) [3] 4
Drag options to blanks, or click blank then click option'
Aw.upper()
Blen(w)
C>
Dw.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase instead of uppercase for keys.
Using '<' instead of '>' in the condition.