Python Programming - Arrays
Exercise : Arrays - General Questions
- Arrays - General Questions
46.
What is the purpose of the NumPy function
numpy.argmax(arr)
?
Answer: Option
Explanation:
The
numpy.argmax()
function returns the index of the maximum value in the array.
47.
What does the NumPy function
numpy.eye(3)
do?
Answer: Option
Explanation:
The
numpy.eye()
function generates an identity matrix of the specified size.
48.
How can you find the mean value along a specific axis in a NumPy array
arr
?
Answer: Option
Explanation:
The
np.mean()
function can compute the mean along a specified axis.
49.
Given two NumPy arrays
arr1
and arr2
, what does np.vstack((arr1, arr2))
do?
Answer: Option
Explanation:
The
np.vstack()
function stacks the arrays vertically.
50.
What is the output of the code
np.arange(2, 10, 2)
?Answer: Option
Explanation:
The code generates an array with values from 2 to 10 (exclusive) with a step of 2.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers