0
0
NumPydata~10 mins

Installing and importing NumPy - Interactive Practice

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 the common alias.

NumPy
import [1] as np
Drag options to blanks, or click blank then click option'
Anpy
Bnum
Cnp
Dnumpy
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'np' directly in the import statement causes an error.
Using 'num' or 'npy' are not correct library names.
2fill in blank
medium

Complete the command to install NumPy using pip in the terminal.

NumPy
pip [1] numpy
Drag options to blanks, or click blank then click option'
Aremove
Binstall
Cupdate
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pip update numpy' does not install the package.
Using 'pip remove numpy' deletes the package instead.
3fill in blank
hard

Fix the error in the import statement to correctly import NumPy.

NumPy
import [1]
Drag options to blanks, or click blank then click option'
AnumPy
Bnp
Cnumpy
Dnumpi
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'np' alone without 'as np' alias.
Misspelling the module name causes import errors.
4fill in blank
hard

Fill both blanks to create a NumPy array from a Python list.

NumPy
import numpy as np
arr = np.[1]([2])
Drag options to blanks, or click blank then click option'
Aarray
Blist
C[1, 2, 3]
Darraylist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' instead of a Python list literal.
Using a wrong function name like 'arraylist'.
5fill in blank
hard

Fill all three blanks to import NumPy, create an array, and print it.

NumPy
import [1] as np
arr = np.[2]([3])
print(arr)
Drag options to blanks, or click blank then click option'
Anumpy
Barray
C[10, 20, 30]
Dnum
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong import alias or misspelling 'numpy'.
Passing a variable name instead of a list to 'array'.