[Numpy-discussion] numpy.sum(..., keepdims=False)

Pierre Haessig pierre.haessig at crans.org
Wed Apr 4 05:37:19 EDT 2012


Hi,

Le 03/04/2012 22:10, Frédéric Bastien a écrit :
> I would like to add this parameter to Theano. So my question is, will
> the interface change or is it stable?
I don't know for the stability, but for the existence of this new parameter:

https://github.com/numpy/numpy/blob/master/numpy/core/fromnumeric.py

looking at "def sum(...)" it seems the keepdims=False parameter is here
and was introduced 7 months ago by Mark Wiebe and Charles Harris.

The docstring indeed says :
    keepdims : bool, optional
    If this is set to True, the axes which are reduced are left
    in the result as dimensions with size one. With this option,
    the result will broadcast correctly against the original `arr`.

The commit message also mentions the skipna parameter, which is part of
the overall NA implementation which is indeed tagged as somehow
experimental (if I'm correct ! ), but I would assume that the
keepdims=False parameter is an orthogonal issue. Hopefully somebody can
give you a more precise answer !

Best,
Pierre

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120404/a929ac7f/attachment.sig>


More information about the NumPy-Discussion mailing list