Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What is NumPy?
A. A web framework
B. A machine learning library
C. A data visualization library
D. A library for numerical computing in Python
Direction: Choose the correct option

Q2.

How do you create a NumPy array from a list?
A. np.asarray([1,2,3])
B. np.list([1,2,3])
C. np.array([1,2,3])
D. Both A and C
Direction: Choose the correct option

Q3.

What does `np.arange(5)` produce?
A. [0 1 2 3 4]
B. [0 1 2 3 4 5]
C. [0,1,2,3,4]
D. [1 2 3 4 5]
Direction: Choose the correct option

Q4.

How do you get the shape of a NumPy array `a`?
A. a.ndim
B. a.shape
C. a.size
D. a.dim
Direction: Choose the correct option

Q5.

What does `np.zeros((2,3))` create?
A. A 2x3 array of random numbers
B. A 2x3 array of zeros
C. A 3x2 array
D. A 2x3 array of ones
Direction: Choose the correct option

Q6.

How do you perform element-wise multiplication of two arrays?
A. a * b
B. np.dot(a,b)
C. a @ b
D. a.multiply(b)
Direction: Choose the correct option

Q7.

What is the output of `np.linspace(0, 10, 5)`?
A. [0,10]
B. [0,1,2,3,4]
C. [0., 2.5, 5., 7.5, 10.]
D. [0,2.5,5,7.5,10]
Direction: Choose the correct option

Q8.

How do you compute the mean of a NumPy array?
A. a.average()
B. Both A and B
C. np.mean(a)
D. a.mean()
Direction: Choose the correct option

Q9.

What does `a.reshape(3,4)` do?
A. Returns a new array with shape 3x4
B. Reshapes to 3 rows and 4 columns
C. Changes the array in-place
D. Both A and C
Direction: Choose the correct option

Q10.

What is the advantage of NumPy arrays over Python lists?
A. Faster operations, less memory
B. All of the above
C. Easier indexing
D. Built-in methods