Fix invalid previous fix for percentile edge case

This commit is contained in:
Johannes Schönberger
2013-07-31 19:50:05 +02:00
parent 7be96b4a01
commit f9f405a8ba
+3 -3
View File
@@ -161,14 +161,14 @@ cdef inline double _kernel_percentile(Py_ssize_t* histo, double pop, dtype_t g,
cdef Py_ssize_t sum = 0
if pop:
if p0 == 0: # make sure p0 == 0 returns the minimum filter
for i in range(max_bin):
if p0 == 1: # make sure p0 = 1 returns the maximum filter
for i in range(max_bin - 1, -1, -1):
if histo[i]:
break
else:
for i in range(max_bin):
sum += histo[i]
if sum >= p0 * pop:
if sum > p0 * pop:
break
return i
else: