Skip to content

Update multi-dimentional array example in xray tutorial #102

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

Merged
merged 2 commits into from
Aug 15, 2021

Conversation

rossbar
Copy link
Collaborator

@rossbar rossbar commented Aug 14, 2021

Just something I noticed while reviewing the alt-text changes in the xray image processing tutorial:

The section on loading an "image stack" had a few points that could be improved on. In the first cell in the section, the images are loaded manually rather than programmatically, which is cumbersome and also error prone - for example, there should be 9 images in the final result instead of 8 given the 0-indexed numbering scheme, but img 002 was left out for some reason.

There is also a benchmarking section where appending images in a for-loop is compared to np.stack - however; this is an apple-to-oranges comparison because the former included the file IO in the loop whereas the latter did not. I also think that creating the arrays directly from the data rather than explicitly stacking pre-loaded 1-D arrays demonstrates the multi-dimensional concept more clearly by cutting out unnecessary steps.

Removes timeit comparison between two loading methods, which was
comparing apples and oranges.
@mattip mattip merged commit d50f534 into numpy:main Aug 15, 2021
@mattip
Copy link
Member

mattip commented Aug 15, 2021

Thanks @rossbar

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.

2 participants