[Numpy-discussion] Re: [Matrix-SIG] Numeric Array: adding a 0-D array to a cell in a 2-D array

Konrad Hinsen hinsen at cnrs-orleans.fr
Fri Feb 25 07:26:58 EST 2000


> We get the type error from trying to set the matrix element with a matrix
> element (apparently).  In the old version (1.9) on our NT box,
> temp=a[kwd,kwd] results in temp being an int type.  How can we either cast
> the temp to an int or enable what we really want, which is to add an int to
> a[kwd,kwd], as in a[kwd,kwd] = a[kwd,kwd] + jwd ?
> 
> Do we have a bad version of Numeric?

Maybe an experimental version. If you check the archives of this
mailing list, you can find a recent discussion about proposed
modifications. One of them was to eliminate the automatic conversion
of rank-0 arrays to scalars, in order to prevent type promotion.
Perhaps this proposal was implemented in the version you have.


Note to the NumPy maintainers: please announce all new releases on
this list, mentioning changes, especially those that affect backward
compatibility. As a maintainer of code that makes heavy use of NumPy,
I keep getting questions and bug reports caused by some new NumPy
release that I haven't even heard of. A recent example is the change
of location of the header files; C modules using arrays now have to
include Numeric/arrayobject.h instead of simply arrayobject.h. I can
understand this change (although I am not sure it's important enough
to break compatibility), but I'd have preferred to learn about it
directly and as early as possible. It's really no fun working through
a 2 KB bug report sent by someone with zero knowledge of C.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the NumPy-Discussion mailing list