Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Doc: User Guide "Creating matrices" figures do not match corresponding code #18524

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
ml-practitioner opened this issue Mar 2, 2021 · 4 comments Β· Fixed by #20115
Closed

Doc: User Guide "Creating matrices" figures do not match corresponding code #18524

ml-practitioner opened this issue Mar 2, 2021 · 4 comments Β· Fixed by #20115

Comments

@ml-practitioner
Copy link

The 2nd, 3rd, and 4th figures under the "Creating matrices" section of the User Guide don't match the corresponding code. The example code creates a (2, 2)-shaped array but several of the accompanying figures show a (3, 2)-shaped array highlighting answers that differ from the code (see attached image of 2nd and 3rd figures):

NumpyUserGuideFigure

Interestingly, in the 4th figure, the array values are also non-sequential ([[1, 2], [5, 3], [4, 6]]) and the answer displayed for max(axis=0), in addition to not agreeing with the corresponding code is actually incorrect (should have been [2, 5, 6] and not [5, 6]):

NumpyUserGuideFigureB

To avoid confusing NumPy beginners, please either update the code to match the corresponding figures or correct the figures.

@melissawm
Copy link
Member

Thank you for reporting this, @ml-practitioner . I propose using the 3-by-2 array for all examples and fixing the code. Having a non-square array helps with the comprehension here, in my opinion.

For the 4th figure, the non-sequential values (I think) are also meant to create a non-trivial example. In that case, it might be better to have data = np.array([[1, 2], [5, 3], [4, 6]]) throughout these 4 examples, so we will need to update the figures. @MarsBarLee can help with that.

Let me know if this looks like a reasonable solution.

@ml-practitioner
Copy link
Author

I agree with both of your suggestions. If you're going to update the figures, might I also suggest orienting the "2 5 6" on the right side of the 4th figure horizontally instead of vertically? The vertical orientation implies the result is [3, 1]-shaped rather than its actual [3,]-shape.

This can be a very confusing topic for beginners, so thank you for addressing this. Oh, and I see now that I incorrectly stated that the answer for the left-hand side of the 4th figure was [2, 5, 6]--the correct answer is indeed [5, 6] as shown.

@AlexanderPatino
Copy link

I am interested in updating the figures for this issue and would appreciate some direction regarding the accepted process for creating these PNG images.

@MarsBarLee
Copy link
Contributor

Hi @AlexanderPatino, thank you so much for your interest in working on this issue! However Melissa and I are already working on updating these graphics. You can check out our NumPy Documentation tracking issue here to see on other issues you can help out on. In terms of the process for creating images, we're looking to create SVGs which can be done on graphics software such as Inkscape. If you have any questions, please let us know in the tracking issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants