-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC: The axis argument of average can be a tuple of ints #8611
Conversation
numpy/lib/function_base.py
Outdated
axis : int or tuple of ints, optional | ||
Axis or axes along which to average `a`. If `None`, averaging is done | ||
over the flattened array. | ||
If this is a tuple of ints, averaging is performed over multiple axes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a single paragraph, i.e., combined with preceding line. I'd cut and paste from the corresponding part of the sum
docstring with relevant changes to have a more complete explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the .. versionadded::
found in sum
would also be correct here. I'd feel happier if this functionality was tested :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied this from:
numpy/numpy/core/fromnumeric.py
Lines 2803 to 2810 in eefc4b8
axis : None or int or tuple of ints, optional | |
Axis or axes along which the means are computed. The default is to | |
compute the mean of the flattened array. | |
.. versionadded:: 1.7.0 | |
If this is a tuple of ints, a mean is performed over multiple axes, | |
instead of a single axis or all the axes as before. |
Do you like the mean formatting or the sum formatting?
I wasn't sure of what version added to use. I can use .. versionadded:: 1.7.0
if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that version is probably correct as the functionality seems more inherited than intentional. The sum
docs seem a bit better to me with regard to the tuple.
See |
802f5bc
to
0b72157
Compare
fixed |
Thanks @cancan101 . |
Closes #8604