FUNDAMENTALS OF COMPUTER

DATABASE FUNDAMENTALS

DATA WAREHOUSING AND DATA MINING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following pair of methods return the position of the maximum and minimum element (respectively) of a numpy array narr?
A
narr.max(), narr.min()
B
narr.maxind(), narr.minind()
C
narr.argmax(), narr.argmin()
D
narr.maxpos(), narr.minpos()
Explanation: 

Detailed explanation-1: -ptp() The numpy. ptp() function returns the range (maximum-minimum) of values along an axis.

Detailed explanation-2: -Python provides different inbuilt function. min() is used for find out minimum value in an array, max() is used for find out maximum value in an array. index() is used for finding the index of the element.

Detailed explanation-3: -The numpy. argmin() method returns indices of the min element of the array in a particular axis. Return : Array of indices into the array with same shape as array.

Detailed explanation-4: -You can use this built-in max() to find the maximum element in a one-dimensional NumPy array, but it has no support for arrays with more dimensions.

There is 1 question to complete.