Issue
If I calculate 90 percentile using numpy:
import numpy as np
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
p = np.percentile(a, 90)
print (p)
It cuts the highest value so the result is:
9.1
How to cut instead the lower values so the output would be:
2
Thank you!
Solution
You want the 10th percentile, not the 90th.
p = np.percentile(a, 10)
print (p)
# 1.9
Answered By - James
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.