News for hackers. Stuff that matters.
Re:Python Programming and Numerical Methods: A Guide for Eng... by alejoar on Wednesday February 17, 2021 @07:47AM (#26165723)
Libraries like numpy are implemented in C under the hood, and you can also easily extend your Python code with C.
Re:Python Programming and Numerical Methods: A Guide for Eng... by enriquto on Wednesday February 17, 2021 @08:01AM (#26165820)
> you can also easily extend your Python code with C

Or, more precisely, you can easily wrap your algorithm written in C by a bit of boilerplate Python code (if that is your fancy).

Re:Python Programming and Numerical Methods: A Guide for Eng... by fauigerzigerk on Wednesday February 17, 2021 @08:26AM (#26166019)
Or you could use Cython to do a bit of both at the same time.
Re:Python Programming and Numerical Methods: A Guide for Eng... by enriquto on Wednesday February 17, 2021 @09:02AM (#26166332)
I don't see the advantage. If you use cython then your code becomes quite difficult to use in the rest of the C ecosystem (where your algorithm belongs).
Re:Python Programming and Numerical Methods: A Guide for Eng... by counters on Wednesday February 17, 2021 @09:14AM (#26166458)
Usually if you use Cython, f2py, numba, or something similar, the goal isn't to create code that fits into the ecosystem of the compiled language - it's to optimize a kernel that fits into the Python ecosystem with minimal baggage.