Write a NumPy program to find the position of the index of a specified value greater than existing value in NumPy array
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
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
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال