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

A few points for improving the indexing notebooks #206

Open
2 of 4 tasks
negin513 opened this issue Jul 11, 2023 · 3 comments
Open
2 of 4 tasks

A few points for improving the indexing notebooks #206

negin513 opened this issue Jul 11, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@negin513
Copy link
Contributor

negin513 commented Jul 11, 2023

From today's presentation, I can think of a few things to improve the whole indexing materials:

  • Advanced indexing :
  • Add a schematic image on the subsetted points to explain the difference between the orthogonal vs. point-wise indexing.
    Something similar to this:

The right figure here shows it for Numpy/ poinwise indexing: image
Here is another one showing the orthogonal indexing:

  • Adding an exercise for this notebook.
  • Adding an example for this warning:
    If an indexer is a DataArray(), its coordinates should not conflict with the selected subpart of the target array (except for the explicitly indexed dimensions with .loc/.sel). Otherwise, IndexError will be raised!
  • Boolean indexing:
  • Adding a plot of all grid locations to show how dims and physical coordinates are different for the curvilinear grid.
@negin513 negin513 changed the title Improving some materials Improving some indexing tutorial tutorial materials Jul 11, 2023
@negin513 negin513 changed the title Improving some indexing tutorial tutorial materials Improving some indexing tutorial materials Jul 11, 2023
@negin513 negin513 changed the title Improving some indexing tutorial materials A few points for improving the indexing notebooks Jul 11, 2023
@negin513
Copy link
Contributor Author

Here is another one I have found from Matlab:
matlab

@dcherian
Copy link
Contributor

These images are great! Thanks Negin.

@negin513
Copy link
Contributor Author

negin513 commented Jul 13, 2023

Okay, so I created this for adding to the tutorial, to better explain these concepts:

Untitled drawio (1)

np_arr = np.arange(1, 26).reshape(5, 5)
np_arr [[0, 2, 4], [0, 2, 4]]
da = xr.DataArray(np_arr)
da [[0, 2, 4], [0, 2, 4]]

I will add these to our notebooks soon...

@scottyhq scottyhq added the enhancement New feature or request label Feb 21, 2024
@negin513 negin513 self-assigned this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants