[Numpy-discussion] numarray rank-0 decisions, rationale, and summary

Konrad Hinsen hinsen at cnrs-orleans.fr
Tue Sep 24 14:19:04 CDT 2002


"Perry Greenfield" <perry at stsci.edu> writes:

> Questions:
> 
> 1) given 2, is there still a desire for .reduce() to return
> rank-0 arrays (if not, we have .areduce() which is intented to return
> arrays always).
> 
> 2) whichever is the "returns arrays always" reduce method, should the 
> endpoint be rank-0 arrays or rank-1 len-1 arrays?

I don't really see an application where a reduction operation yielding
rank-1 or higher arrays would be useful. It would be a special case,
not useful for generic programming. So my answer to 2) is rank-0.

As for 1), if indexing doesn't return rank-0 arrays, then standard
reduction shouldn't either. We would then have a system in which
rank-0 arrays are "expert only" stuff, most users would never see
them, and they could safely be ignored in tutorials.

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
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