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

Air pollution tutorial should show path to "vectorization" #152

Open
seberg opened this issue Nov 1, 2022 · 1 comment
Open

Air pollution tutorial should show path to "vectorization" #152

seberg opened this issue Nov 1, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@seberg
Copy link
Member

seberg commented Nov 1, 2022

The air polution tutorial has a "vectorized" function to calculte the AIQ (IIRC). This can be vectorized using searchsorted (which is a bit much work, but not too tricky).
I am also almost completely certain that it can also be replaced with a single call to np.interp1d.

Having the "vectorize" version seems good, but doesn't fully leverage the concepts that NumPy provides. I think it would be great arc to keep it, but then also show the final interp and maybe even the searchsorted idea. (I honestly don't like stopping at vectorize becuzse it makes seems that vectorize is a common approach, when I consider it more of a fallback solution – whether used a lot in practice or not.)

@ankur0904
Copy link

@rossbar I am working on this issue soon submit a PR.

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