Serendip is an independent site partnering with faculty at multiple colleges and universities around the world. Happy exploring!

You are here

Why not just use the library function?

Doug Blank's picture

This post captures some good reasons for having an algorithm in Python, rather than simply calling a fast library function:

https://jakevdp.github.io/blog/2015/02/24/optimizing-python-with-numpy-and-numba/

  • Pure-Python code is easier to read, understand, and contribute to. 

  • Pure-python packages are much easier to install than Python-wrapped C or Fortran code. 

  • Pure-python code often works for many data types. 

  • Pure-python is easier to use at scale.

-Doug