https://www.machinelearningplus.com/101-numpy-exercises-python/
NumPy Exercises for Data Analysis in Python
machinelearningplus.com
1–10 of 34 posts
https://www.machinelearningplus.com/101-numpy-exercises-python/
NumPy Exercises for Data Analysis in Python
machinelearningplus.com
This is very similar in spirit to https://github.com/rougier/numpy-100/blob/master/100%20Numpy... . In fact, now that I look at it a bit more, it seems like all of this post's examples are reworded versions of Nicolas Rougier's "numpy 100"...
This is very similar in spirit to https://github.com/rougier/numpy-100/blob/master/100%20Numpy... . In fact, now that I look at it a bit more, it seems like all of this post's examples are reworded versions of Nicolas Rougier's "numpy 100"...
Look a little bit more, please.
For question 48 it might be simpler to just write
np.sort(a)[-5:]
instead of using argsort() and then using fancy indexing. Better yet, use np.partition(a, kth=-5)[-5:]
which scales linearly with the size of the array.Also, the one-hot encoding puzzle (51) would be more efficiently solved using
(arr[:, None] == np.unique(arr)).view(np.int8)
In general, `for` loops over NumPy arrays should be avoided where at all possible.I've found the following to be quite helpful but would love to know if anyone knows of other resources in a similar vein: https://pandas.pydata.org/pandas-docs/stable/cookbook.html
Does anyone know of any similar resources for Pandas? I've found the following to be quite helpful but would love to know if anyone knows of other resources in a similar vein: https://pandas.pydata.org/pandas-docs/stable/cookbook.html
There's also pandas_exercises by Guilherme Samora (https://github.com/guipsamora/pandas_exercises) which is very good - it's split across multiple notebooks and is more extensive than my repo.