Skip to content
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

updated the note for "insert" so that it points to the explanation of why ...0... and ...[0]... are wildly different. #25895 #26114

Closed
wants to merge 1 commit into from

Conversation

Chillthrower
Copy link

@Chillthrower Chillthrower commented Mar 22, 2024

updated the note for "insert" so that it points to the explanation of why ...0... and ...[0]... are wildly different. #25895

@Chillthrower Chillthrower changed the title updated the note for "insert" so that it points to the explanation of… updated the note for "insert" so that it points to the explanation of why ...0... and ...[0]... are wildly different. #25895 Mar 22, 2024
Comment on lines +5556 to +5558
``arr[:,[0],:] = values``. This is due to the way NumPy handles broadcasting and
axis manipulation. For a detailed explanation, refer to the documentation on
[Broadcasting](https://numpy.org/doc/stable/user/basics.broadcasting.html).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``arr[:,[0],:] = values``. This is due to the way NumPy handles broadcasting and
axis manipulation. For a detailed explanation, refer to the documentation on
[Broadcasting](https://numpy.org/doc/stable/user/basics.broadcasting.html).
``arr[:,[0],:] = values``. This is due to the way NumPy handles
:ref:`broadcasting <basics.broadcasting>` and axis manipulation.

Thank you for contributing to Numpy. I noticed the line length was too long and I updated your example to use the internal link structure.

@mattip
Copy link
Member

mattip commented May 29, 2024

I don' think pointing users to the broadcasting document is the right way to help them here. If anything, it should be the indexing documentation, but there should be a further explanation of why the indexing makes the results change.

I will close this, please open a new PR if you are interested in pursuing this.

@mattip mattip closed this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants