A really great way to learn more about numpy is with Math Inspector[1]. It creates a block coding environment which works with the entire numpy/scipy stack, it also has an interactive 2d and 3d plotting library that updates the functionality in mathplotlib. Also, I made it =) Just spent the past 3 months working day and night and released a massive update a few days ago. Check out the youtube video on the bottom of the page for more in depth information.<p>[1] <a href="https://mathinspector.com/" rel="nofollow">https://mathinspector.com/</a>
NumPy is incredible to me: it serves not only as a critical bare-metal layer, but also an essential tool in its own right, and I can’t imagine using Python without it. I do numerical work—ML/data science/statistics—and I simply couldn’t accomplish any of what I do without the functionality provided by NumPy. np.array alone is worth all the king’s gold.<p>It is interesting to me that in many respects it serves as “guts”. I definitely drop down to use numpy directly with regularity. But it’s also possible to do 80-90% of the job without ever explicitly using the module itself. It’s baked in everywhere, to the point that it feels like just another standard library.<p>Exciting to see progress! Keep up the good work, numpy team :)
Quick summary: "This NumPy release is the largest so made to date, some 684 PRs contributed by 184 people have been merged."<p><pre><code> > Annotations for NumPy functions. This work is ongoing and improvements can be expected pending feedback from users.
> Wider use of SIMD to increase execution speed of ufuncs. Much work has been done in introducing universal functions that will ease use of modern features across different hardware platforms. This work is ongoing.
>Preliminary work in changing the dtype and casting implementations in order to provide an easier path to extending dtypes. This work is ongoing but enough has been done to allow experimentation and feedback.
> Extensive documentation improvements comprising some 185 PR merges. This work is ongoing and part of the larger project to improve NumPy’s online presence and usefulness to new users.
> Further cleanups related to removing Python 2.7. This improves code readability and removes technical debt.
> Preliminary support for the upcoming Cython 3.0.
</code></pre>
Type annotations seem the biggest deal to me. I'd say if you care a lot about SIMD and the performance issues, you should be thinking of moving to Julia: it's still a valuable technical achievement.
"sliding_window_view" method will be a great addition. Sliding windows are used quite frequently when analysing data and currently you can kind of achieve it using "as_strided" method but that method is very cumbersome to use. But from the examples given, "sliding_window_view" is much easier to use.
I _love_ numpy, and I am getting excited about jax, too.<p>However, I do have one request for it. Getting the argmax of a multi-dimensional array, in terms of the array's dimensions, is difficult for new users.<p>np.argmax(np.array([[1,2,3],[1,9,3],[1,2,3]])) is 4, rather than (1,1). I understand why, but it seems strange to me that argmax cannot return a value the user can use to index their array.<p>Having to then feed that `4` into unravel_index() with the array's shape as a parameter seems less elegant than say passing a parameter of "as_index=True" to the argmax.
NumPy/Pandas is one of the reasons I'm stuck on Python. I'd prefer a strongly typed language like go/java/rust but there isn't the same library or community. Any recommendations? Its for applications not just DS/ML so Julia isn't really in scope.
If you know Python, then trying NumPy is pain.<p>Because for some reason data scientists have managed to misuse the python syntax. E.g. `np.ogrid[ -200000000:200000000:100j,-500000:500000:100j]` it's completely unexplainable what this does. They have managed to overload index/slice operator and imaginary numbers to produce two arrays.<p>(Example taken from here <a href="https://asecuritysite.com/comms/plot06" rel="nofollow">https://asecuritysite.com/comms/plot06</a> )
I've been getting some odd warnings (thousands of them) from CI runs against 1.20, typical:<p><pre><code> some-file.py:83: DeprecationWarning: `np.bool` is a
deprecated alias for the builtin `bool`. To silence
this warning, use `bool` by itself. Doing this will
not modify any behavior and is safe. If you specifically
wanted the numpy scalar type, use `np.bool_` here.
Deprecated in NumPy 1.20; for more details and guidance:
https://numpy.org/devdocs/release/1.20.0/notes.html#deprecations
return self.z[j][i]
</code></pre>
But all of the lines mentioned in these warning do not reference np.bool
There's a random shuffle function. Instead of writing one out using an algorithms textbook. Lots of data types get randomly shuffled during coding.<p>Shuffles arrays and lists.
<a href="https://numpy.org/doc/stable/reference/random/generated/numpy.random.shuffle.html" rel="nofollow">https://numpy.org/doc/stable/reference/random/generated/nump...</a>
The most interesting question here is the newest competitor to Numpy - Tensorflow - <a href="https://www.tensorflow.org/guide/tf_numpy" rel="nofollow">https://www.tensorflow.org/guide/tf_numpy</a><p>With the added advantage that TF is natively accelerated on M1.<p>Will TF-Numpy maintain parity ?