[Numpy-discussion] Counting array elements

Stephen Walton stephen.walton at csun.edu
Sun Oct 24 19:22:03 EDT 2004


On Fri, 2004-10-22 at 14:47, Fernando Perez wrote:

> silly, minor nit: can we avoid mixed case names? Either sum_all or SumAll? I'm 
> not too fond of CamelCase, but camelCase looks even worse to me :)

I agree with Fernando about CamelCase (which among other things
seriously bites one when moving from case-sensitive to case-insensitive
OS's).  But I want to make a broader point:

I don't think we need sumall.  The methods and the functions should
simply work the same way.  If one wants sumall, use A.flat.sum() or, if
you can't use the methods or attributes on your old version of Python,
sum(ravel(A)).  If you start writing sumall, then you'll need meanall,
stdall, prodall, etc, etc.  The flat attribute and ravel function/method
already provide all the needed functionality.

Just trying to save Todd some work.

Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20041024/011e3cb7/attachment.sig>


More information about the NumPy-Discussion mailing list