From b5e05ceae525ef9a08148a5f52fcffd3afeb900d Mon Sep 17 00:00:00 2001 From: Ana Ruelas Date: Wed, 8 Mar 2017 11:05:54 -0500 Subject: [PATCH] BUG: ceil returns float, int needed for array indexing --- zipline/pipeline/factors/factor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/pipeline/factors/factor.py b/zipline/pipeline/factors/factor.py index 9b552ef9..4477104b 100644 --- a/zipline/pipeline/factors/factor.py +++ b/zipline/pipeline/factors/factor.py @@ -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: