Share

Use Cython to accelerate array iteration in NumPy

NumPy is known for being fast, but could it go even faster? Here’s how to use Cython to accelerate array iterations in NumPy.

NumPy gives Python users a wickedly fast library for working with data in matrixes. If you want, for instance, to generate a matrix populated with random numbers, you can do that in a fraction of the time it would take in conventional Python.

Still, there are times when even NumPy by itself isn’t fast enough. If you want to perform transformations on NumPy matrixes that aren’t available in NumPy’s API, a typical approach is to just iterate over the matrix in Python … and lose all the performance benefits of using NumPy in the first place.

To read this article in full, please click here

Author: . [Source Link (*), InfoWorld]

Shop with us!