CARVIEW |
Basic NumPy Concepts
This section will introduce you to the foundational elements of NumPy, including how to import it, its primary features, and its key differences from Python lists.
Question 1
What does the NumPy library primarily deal with?
Strings
Arrays
Machine Learning
DataFrames
Question 2
How do you import NumPy in Python?
import numpy as np
import NumPy as np
import np as numpy
import numpy
Question 3
NumPy arrays are ________
Immutable
Faster than Python lists
Slower than Python lists
Only for integers
Question 4
Which method gives the version of NumPy?
numpy.version()
numpy.__version__
numpy.version
numpy.get_version()
Question 6
Which of the following is NOT a valid NumPy datatype?
np.float64
np.bool
np.object
np.string
Question 7
What does np.arange(5) return?
An array of integers from 0 to 4
An array of floating-point numbers from 0 to 5
An array of integers from 1 to 5
An array of random numbers
Question 8
What is the shape of a NumPy array created using np.array([[1, 2], [3, 4]])
?
(2,)
(2, 2)
(2, 1)
(1, 2)
Question 10
What does np.zeros(3) create?
A 3-dimensional array of zeros
A 1-dimensional array with 3 zeros
A 3x3 matrix of zeros
A list of 3 zeros
There are 10 questions to complete.