%timeit -n 1 -r 1 test_function()
where n
is the number of consecutive tests and r
is the repetition for each test
%prun load_data()
Profile generic function with functions hit counter ordered by occurences
Install:
pip install line_profiler
Load profiler in IPython
%load_ext line_profiler
Call profiler:
%lprun -f <FUNCTION_TO_CHECK> <FUNCTION_TO_RUN>
FUNCTION_TO_CHECK
is the reference (not the quoted string) to the function to check line-by-line and FUNCTION_TO_RUN
is the piece-of-code or function to profile (the latter should call the former...)