Numeric write-in place facility

Konrad Hinsen hinsen at
Mon Nov 29 16:27:41 CET 1999

"Ionel Simionescu" <ionel at> writes:

> Playing around I see now that other ufuncs allow a write-in target
> specification as their last argument. For example,
> Numeric.sqrt(a,b)
> will put the result in b (if its dimension and type are Ok).
> The docs do not tell much about this.
> Can anyone confirm/clarify/comment ?

I can confirm that the feature exists and that it is well hidden ;-)

This was implemented to permit the fast evaluation of complicated
formulas without the allocation of temporary arrays for each
intermediate. Using this approach means more work and less readable
code, but also faster execution and lower memory needs.
Konrad Hinsen                            | E-Mail: hinsen at
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-
Rue Charles Sadron                       | Fax:  +33-
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais

More information about the Python-list mailing list