Python Numpy Quiz (original) (raw)
- A machine learning framework
- A scientific computing library
- A web development framework
How can you create a NumPy array from a Python list?
What is the shape of a 1D NumPy array with 5 elements?
How can you access the element at the second row and third column of a 2D NumPy array arr?
Question: What does the np.zeros((3, 4)) function in NumPy do?
- Creates an array with ones
- Creates an array with random values
- Creates an array with zeros
- Creates an identity matrix
How can you perform element-wise multiplication of two NumPy arrays a and b?
What does the np.arange(5, 15, 2) function in NumPy do?
- Creates an array with values from 5 to 15
- Creates an array with values from 5 to 14 with a step of 2
- Creates an array with values from 5 to 15 with a step of 2
- Creates an array with values from 5 to 14
How can you find the mean of a NumPy array arr?
What is the purpose of the np.reshape() function in NumPy?
- Changes the shape of an array
What is the correct way to calculate the dot product of two NumPy arrays a and b?
- dot_product = np.dot(a, b)
- dot_product = np.cross(a, b)
There are 25 questions to complete.
Take a part in the ongoing discussion