Write a NumPy program to compute the 80th percentile for all elements in a given array along the second axis
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
x = np.arange(12).reshape((2, 6))
print("\nOriginal array:")
print(x)
r1 = np.percentile(x, 80, 1)
print("\n80th percentile for all elements of the said array along the second axis:")
print(r1)
Sample Output:
Original array: [[ 0 1 2 3 4 5] [ 6 7 8 9 10 11]] 80th percentile for all elements of the said array along the second axis: [ 4. 10.]
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال