0
0
Data Analysis Pythondata~10 mins

Why NumPy is the numerical backbone in Data Analysis Python - 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 NumPy library with its common alias.

Data Analysis Python
import [1] as np
Drag options to blanks, or click blank then click option'
Apandas
Bnumpy
Cmatplotlib
Dscipy
Attempts:
3 left
💡 Hint
Common Mistakes
Using pandas instead of numpy.
Forgetting to use the alias np.
Importing matplotlib or scipy by mistake.
2fill in blank
medium

Complete the code to create a NumPy array from a Python list.

Data Analysis Python
arr = np.[1]([1, 2, 3, 4])
Drag options to blanks, or click blank then click option'
Aarray
Blist
Cmatrix
Dseries
Attempts:
3 left
💡 Hint
Common Mistakes
Using list instead of array.
Trying to use series which is from pandas.
Using matrix which is different from array.
3fill in blank
hard

Fix the error in the code to calculate the mean of a NumPy array.

Data Analysis Python
mean_value = arr.[1]()
Drag options to blanks, or click blank then click option'
Amean
Baverage
Cmedian
Dmode
Attempts:
3 left
💡 Hint
Common Mistakes
Using average() as a method on the array.
Using median() which returns the middle value, not the mean.
Using mode() which is not a NumPy array method.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each number to its square if the number is even.

Data Analysis Python
squares = {x: x[1]2 for x in range(1, 6) if x [2] 2 == 0}
Drag options to blanks, or click blank then click option'
A**
B%
C//
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using + instead of exponentiation.
Using // which is floor division, not modulus.
Using == incorrectly without modulus.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase words to the original words if the length is greater than 3.

Data Analysis Python
result = { [1]: [2] for word in words if len(word) [3] 3 }
Drag options to blanks, or click blank then click option'
Aword.upper()
Bword
C>
Dlen(word)
Attempts:
3 left
💡 Hint
Common Mistakes
Using len(word) as the key instead of uppercase word.
Using < instead of > in the condition.
Swapping key and value positions.