From 4e1bffa7cc430a9275bcc4c9c27a907c78395cda Mon Sep 17 00:00:00 2001 From: mosessky Date: Sun, 2 Mar 2014 21:16:39 -0800 Subject: BUG: fix ValueError for byte_bounds() on datetime array close gh-4345 --- numpy/lib/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'numpy/lib/utils.py') diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 1f1cdfc8a..791f271b1 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -210,8 +210,9 @@ def byte_bounds(a): a_data = ai['data'][0] astrides = ai['strides'] ashape = ai['shape'] - bytes_a = int(ai['typestr'][2:]) - + + bytes_a = asarray(a).dtype.itemsize + a_low = a_high = a_data if astrides is None: # contiguous case a_high += a.size * bytes_a -- cgit v1.2.1