DOC: clarify documentation for transpose()#15024
Conversation
e49c534 to
dedee47
Compare
dedee47 to
9bf03f6
Compare
numpy/core/fromnumeric.py
Outdated
| according to the values given. | ||
| axes : tuple or list of ints, optional | ||
| If not specified, this function reverses the order of the axes. | ||
| If specified, it must be a tuple, list or similar object which contains |
There was a problem hiding this comment.
"similar object", is typically called "sequence" in python language. In fact, tuple or list can probably also be replaced with sequence. Unless we want to nudge people towards tuple specifically (since in many cases axes has to be a tuple).
Looks good to me.
There was a problem hiding this comment.
I would lean towards documenting it as just tuple or list, and not encouraging users to to pass anything else.
numpy/core/fromnumeric.py
Outdated
| For an array a with two axes, transpose(a) gives the matrix transpose | ||
| of a. |
There was a problem hiding this comment.
I think PEP257 needs a blank line before this sentence.
| For an array a with two axes, transpose(a) gives the matrix transpose | |
| of a. | |
| For an array ``a`` with two axes, ``transpose(a)`` gives the matrix transpose | |
| of a. |
|
Addressed the comments |
|
Thanks, if you still have some patience. I noticed that the |
|
No problem, LMK if the new version works.
…On Tue, Dec 3, 2019 at 11:47 PM Sebastian Berg ***@***.***> wrote:
Thanks, if you still have some patience. I noticed that the return
section says it normally returns a view. That is incorrect. transpose
will *always* return a view.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15024?email_source=notifications&email_token=AAZFLO5QROJ7GSTVEO7NABLQWZ5RPA5CNFSM4JTPM6GKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFZ2O3I#issuecomment-561227629>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZFLO5N7DAKJMTL7LT3CN3QWZ5RPANCNFSM4JTPM6GA>
.
|
You wish...
|
d56e5a1 to
a563892
Compare
|
Fixed it the easiest way I knew, by force-pushing the previous commit again.
…On Wed, Dec 4, 2019 at 5:07 AM Eric Wieser ***@***.***> wrote:
That is incorrect. transpose will always return a view.
You wish... transpose will return whatever the subclass of ndarray
decides to implement their transpose method as, which in the past has
*not* always been a view. I think this came up when I was implementing
#8441 <#8441>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15024?email_source=notifications&email_token=AAZFLO66R245X4UWBXVM3GTQW3DBRA5CNFSM4JTPM6GKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF22DWY#issuecomment-561357275>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZFLO6GK6OHKISLSRG6VM3QW3DBRANCNFSM4JTPM6GA>
.
|
:( |
|
@seberg: See my edit - we discussed this before. |
|
Guys, if I am supposed to make any change to this it's not clear to me. Just a reminder- please clarify if it's not OK. |
|
Sounds like an improvement. Thanks @danpovey. |
No description provided.