summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-11-17 14:40:14 -0500
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:38 -0700
commitf94279eea4525802ef682b8e30c55a67fb21a150 (patch)
tree9568e888fc7d594909bc9238d2b7cef59b27898a
parentb11c8399979c7494092599001a9ab013b17667c1 (diff)
downloadchroma-f94279eea4525802ef682b8e30c55a67fb21a150.tar.gz
chroma-f94279eea4525802ef682b8e30c55a67fb21a150.tar.bz2
chroma-f94279eea4525802ef682b8e30c55a67fb21a150.zip
Cast numpy sum to Python int to make PyROOT happy.
-rw-r--r--chroma/tools.py2
1 files changed, 1 insertions, 1 deletions
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`.'''