Write a NumPy program to get the indices of the sorted elements of a given array
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
student_id = np.array([1023, 5202, 6230, 1671, 1682, 5241, 4532])
print("Original array:")
print(student_id)
i = np.argsort(student_id)
print("Indices of the sorted elements of a given array:")
print(i)
Sample Output:
Original array: [1023 5202 6230 1671 1682 5241 4532] Indices of the sorted elements of a given array: [0 3 4 6 1 5 2]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال