[Numpy-discussion] A case for rank-0 arrays

Francesc Altet faltet at carabos.com
Thu Feb 23 09:04:03 CST 2006


Hi Sasha,

A Dissabte 18 Febrer 2006 20:49, Sasha va escriure:
> I have reviewed mailing list discussions of rank-0 arrays vs. scalars
> and I concluded that the current implementation that contains both is
> (almost) correct.  I will address the "almost" part with a concrete
> proposal at the end of this post (search for PROPOSALS if you are only
> interested in the practical part).
>
> The main criticism of supporting both scalars and rank-0 arrays is
> that it is "unpythonic" in the sense that it provides two almost
> equivalent ways to achieve the same result.  However, I am now
> convinced that this is the case where practicality beats purity.

It's a bit late, but I want to support your proposal (most of it).
I've also come to the conclusion that scalars and rank-0 arrays should
coexist. This is something that appears as a natural fact when you
have to deal regularly with general algorithms for treat objects with
different shapes. And I think you have put this very well.

Thanks,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"





More information about the Numpy-discussion mailing list