8000 np.transpose documentation · Issue #15020 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

np.transpose documentation #15020

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

Closed
danpovey opened this issue Dec 1, 2019 · 2 comments
Closed

np.transpose documentation #15020

danpovey opened this issue Dec 1, 2019 · 2 comments

Comments

@danpovey
Copy link
Contributor
danpovey commented Dec 1, 2019

The documentation for np.transpose is extremely unclear.

By default, reverse the dimensions, otherwise permute the axes

   Permute the dimensions of an array.
    Parameters
    ----------
    a : array_like
        Input array.
    axes : list of ints, optional
        By default, reverse the dimensions, otherwise permute the axes
        according to the values given.

Firstly, the use of the two terms "dimensions" and "axes" to mean apparently the same thing is confusing.

The sentence "By default, reverse the dimensions, otherwise permute the axes according to the values given" is the documentation for "axes" yet it read as if it were the documentation for the whole function. And it is nonspecific about which order it's done in, e.g. will axis numbered i of the input become the axis numbered axes[i] of the output, or vice versa?

The following would be clearer and more explicit.
(I am just showing the first part.. the later part is OK.)

    Reverse or permute the axes of an array; returns the modified array. 
    For an array a with two axes, transpose(a) is equivalent to the 
    matrix transpose of a.

    Parameters
    ----------
    a : array_like
        Input array.
    axes : array_like (e.g. tuple or list), optional
        If not specified, this function reverses the order of the axes.
        If specified, it must be an array_like object which contains a 
        permutation of [0,1,..,N-1] where N is the number of axes of a.
        The i'th axis of the returned matrix will correspond to the axis
        numbered axes[i] of the input.
@eric-wieser
Copy link
Member

Please make a PR out of this :)

@seberg
Copy link
Member
seberg commented Dec 6, 2019

Closed by gh-15024.

@seberg seberg closed this as completed Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0