From: George S. <geo...@gm...> - 2006-11-03 19:11:00
|
Can anyone explain this ? >>> import numpy as N >>> x = N.arange(1,6,dtype='B') >>> x array([1, 2, 3, 4, 5], dtype=uint8) >>> N.repeat(x, N.ones(5,'H')) array([1, 2, 3, 4, 5], dtype=uint8) >>> N.repeat(x, N.ones(5,'l')) array([1, 2, 3, 4, 5], dtype=uint8) >>> N.repeat(x, N.ones(5,'L')) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.4/site-packages/numpy/core/fromnumeric.py", line 83, in repeat return repeat(repeats, axis) TypeError: array cannot be safely cast to required type Thanks, George |