diff options
author | mosessky <skytang@ucdavis.edu> | 2014-03-02 21:16:39 -0800 |
---|---|---|
committer | mosessky <skytang@ucdavis.edu> | 2014-03-02 21:32:14 -0800 |
commit | 4e1bffa7cc430a9275bcc4c9c27a907c78395cda (patch) | |
tree | e185bc3544419369b27ebbe4e571ec9c44b2f910 /numpy/lib/utils.py | |
parent | 0dbd06f95d37e42bea3708954e539db70592e7ea (diff) | |
download | numpy-4e1bffa7cc430a9275bcc4c9c27a907c78395cda.tar.gz |
BUG: fix ValueError for byte_bounds() on datetime array
close gh-4345
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 |