From f94279eea4525802ef682b8e30c55a67fb21a150 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Thu, 17 Nov 2011 14:40:14 -0500 Subject: Cast numpy sum to Python int to make PyROOT happy. --- chroma/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chroma/tools.py b/chroma/tools.py index 2a1167e..ecfe976 100644 --- a/chroma/tools.py +++ b/chroma/tools.py @@ -6,7 +6,7 @@ import math def count_nonzero(array): '''Return the number of nonzero elements in this array''' - return (array != 0).sum() + return int((array != 0).sum()) def filled_array(value, shape, dtype): '''Create a numpy array of given `shape` and `dtype` filled with the scalar `value`.''' -- cgit