Python Programming - Arrays
Exercise : Arrays - General Questions
- Arrays - General Questions
51.
How can you calculate the element-wise product of two NumPy arrays
arr1
and arr2
?
Answer: Option
Explanation:
The element-wise product can be calculated using the multiplication operator
*
.
52.
What does the NumPy function
numpy.random.rand(2, 3)
do?
Answer: Option
Explanation:
The
numpy.random.rand()
function generates a random array with values between 0 and 1.
53.
How can you find the index of the minimum value in a NumPy array
arr
?
Answer: Option
Explanation:
The
np.argmin()
function returns the index of the minimum value in the array.
54.
Given a NumPy array
arr = np.array([3, 1, 4, 1, 5, 9])
, what does np.sort(arr)
return?
Answer: Option
Explanation:
The
np.sort()
function returns a sorted version of the array.
55.
What does the NumPy function
numpy.flip(arr, axis=1)
do?
Answer: Option
Explanation:
The
numpy.flip()
function flips the array horizontally along the specified axis.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers