Re: [Matrix-SIG] Numeric Array: adding a 0-D array to a cell in a 2-D array
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.