Loading

Quipoin Menu

Learn • Practice • Grow

python-for-ai / NumPy Array Operations
mcq
Direction: Choose the correct option

Q1.

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

Q2.

What is the output of `np.sum([1,2,3])`?
A. 3
B. 1
C. 0
D. 6
Direction: Choose the correct option

Q3.

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

Q4.

What does `np.dot(a,b)` compute for 1D arrays?
A. Cross product
B. Outer product
C. Element-wise product
D. Dot product
Direction: Choose the correct option

Q5.

What is the output of `np.array([1,2]) * 3`?
A. [3,6]
B. [1,2,1,2,1,2]
C. Error
D. [3,6]
Direction: Choose the correct option

Q6.

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

Q7.

What is the output of `np.max([1,5,3])`?
A. 3
B. 1
C. 5
D. 5
Direction: Choose the correct option

Q8.

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

Q9.

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

Q10.

How do you perform matrix multiplication (matmul) between two 2D arrays?
A. a * b
B. a @ b
C. Both A and B
D. np.matmul(a,b)