Write a NumPy program to find the position of the index of a specified value greater than existing value in NumPy array.
import numpy as np n= 4 nums = np.arange(-6, 6) print("\nOriginal array:") print(nums) print("\nPosition of the index:") print(np.argmax(nums>n/2))
Sample Output:
Original array: [-6 -5 -4 -3 -2 -1 0 1 2 3 4 5] Position of the index: 9
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer