line_profiler is a module for doing line-by-line profiling of functions. kernprof is a convenient script for running either line_profiler or the Python standard library's cProfile or profile modules, ...
"As the name suggests line-profiler profiles the runtime of a Python script in a line-by-line manner. From the profiling you can identify **hotspots**; i.e., what lines of code take the longest time ...