Merge pull request #1703 from quantopian/ceil-bugfix

BUG: ceil returns float, int needed for array indexing
This commit is contained in:
Ana Ruelas
2017-03-08 11:35:31 -05:00
committed by GitHub
+1 -1
View File
@@ -1642,7 +1642,7 @@ def winsorize(row, min_percentile, max_percentile):
lowidx = int(min_percentile * num)
a[idx[:lowidx]] = a[idx[lowidx]]
if max_percentile < 1:
upidx = ceil(num * max_percentile)
upidx = int(ceil(num * max_percentile))
# upidx could return as the length of the array, in this case
# no modification to the right tail is necessary.
if upidx < num: