Write a NumPy program to find the indices of the maximum and minimum values along the given axis of an array

  • برمجة بايثون

Write a NumPy program to find the indices of the maximum and minimum values along the given axis of an array

 

الأجوبة

import numpy as np
x = np.array([1, 2, 3, 4, 5, 6])
print("Original array: ",x)
print("Maximum Values: ",np.argmax(x))
print("Minimum Values: ",np.argmin(x))

Sample Output:

Original array:  [1 2 3 4 5 6]                                         
Maximum Values:  5                                                     
Minimum Values:  0
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...