You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
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 thesearchsorted
idea. (I honestly don't like stopping atvectorize
becuzse it makes seems thatvectorize
is a common approach, when I consider it more of a fallback solution – whether used a lot in practice or not.)The text was updated successfully, but these errors were encountered: