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.]
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer