[Numpy-discussion] Bug in numarray<->numpy interaction

Charles R Harris charlesr.harris at gmail.com
Sun Dec 24 12:14:14 CST 2006


On 12/24/06, Norbert Nemec <Norbert.Nemec.list at gmx.de> wrote:
>
> The following snippet demonstrates a problem in the interaction of
> numarray 1.5.2 with numpy 1.0.1 (and older versions):
>
> -------------------
> #!/usr/bin/env python
>
> import numarray, numpy
>
> na = numarray.array(0.)
> np = numpy.array(0.)
>
> na[...] = np
> -------------------
>
> the last linec causes the error
>    "TypeError: NA_setFromPythonScalar: bad value type."
>
> The problem occured in a perfectly normal piece of code combining
> PyTables (internally based on numarray) with calculations done in NumPy.
> AFAICS, it should work but simply is a bug somewhere in numarray or numpy.


Recent versions of PyTables work fine with numpy. Unless you have old tables
using the numarray flavor I suggest making the change. It is probably
possible to read the numarray data into numpy by specifying a particular
flavor in the read statement, but Francesc could probably tell you more
about that.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061224/95b59f24/attachment.html 


More information about the Numpy-discussion mailing list