Re: [Numpy-discussion] chararray __mod__ behavior

2008-07-19 Thread Alan McIntyre
On Fri, Jul 18, 2008 at 8:32 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > That looks like a bug to me. I would have expected at least one of > the following to work: > > A % [[1, 2], [3, 4]] > A % 1 > A % (1, 2, 3, 4) > > and none of them do. I wouldn't expect the last one to work, since

Re: [Numpy-discussion] chararray __mod__ behavior

2008-07-18 Thread Stéfan van der Walt
2008/7/18 Alan McIntyre <[EMAIL PROTECTED]>: > This seems odd to me: > A=np.array([['%.3f','%d'],['%s','%r']]).view(np.chararray) A % np.array([[1,2],[3,4]]) > Traceback (most recent call last): > File "", line 1, in > File "/opt/local/lib/python2.5/site-packages/numpy/core/defchararra

[Numpy-discussion] chararray __mod__ behavior

2008-07-18 Thread Alan McIntyre
This seems odd to me: >>> A=np.array([['%.3f','%d'],['%s','%r']]).view(np.chararray) >>> A % np.array([[1,2],[3,4]]) Traceback (most recent call last): File "", line 1, in File "/opt/local/lib/python2.5/site-packages/numpy/core/defchararray.py", line 126, in __mod__ newarr[:] = res ValueE