From 9fd8ec180d490b04e78eaa92656f5eb5396492af Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Thu, 5 May 2016 02:13:14 -0400 Subject: [PATCH] BUG: View with specific int dtype. Just viewing as int is broken on win32. --- zipline/lib/labelarray.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zipline/lib/labelarray.py b/zipline/lib/labelarray.py index d6cc979a..b707f0cd 100644 --- a/zipline/lib/labelarray.py +++ b/zipline/lib/labelarray.py @@ -353,7 +353,8 @@ class LabelArray(ndarray): # Result is a scalar value, which will be an instance of np.void. # Map it back to one of our category entries. - return self.categories[result.view(int)] + index = result.view(int_dtype_with_size_in_bytes(self.itemsize)) + return self.categories[index] def is_missing(self): """