How can we measure which line in the code took the most time to complete?
The simplest way to do that is via a utility called line__profiler. This utility will show each line of the given code and show how much time was spent on each line. Knowing the distribution of the time that was required helps us focus on the right parts of the code.
Does NumPy run faster than Pandas?
In most cases with numeric computations, Pandas uses NumPy under the hood, so the difference is minimal. It does, however, spend certain additional time on building series and dataframes, when needed. So, for a well-scoped and purely numeric task, it makes sense to switch to pure NumPy.
When should we use Numba? What are the challenges and benefits of using Numba?
Numba uses a modern C compiler with some modern techniques to significantly improve performance. It can also be run on a GPU. Its "...