Python Programming - Arrays
Exercise : Arrays - General Questions
- Arrays - General Questions
16.
What does the
array.extend(iterable) method do?
Answer: Option
Explanation:
The
extend() method in the array module adds elements from an iterable to the end of the array.
17.
How do you find the index of the maximum value in a NumPy array named
arr?
Answer: Option
Explanation:
The
argmax() function in NumPy returns the indices of the maximum value in an array.
18.
What is the purpose of the
numpy.linspace(start, stop, num) function?
Answer: Option
Explanation:
The
numpy.linspace() function generates a NumPy array with evenly spaced values over a specified range.
19.
Which of the following methods is used to reshape a NumPy array?
Answer: Option
Explanation:
The
reshape() method in NumPy is used to change the shape of an array.
20.
In NumPy, what does the function
numpy.mean() do?
Answer: Option
Explanation:
The
numpy.mean() function calculates the mean (average) of the array values.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers