Using a line profiler can be very helpful, just add @Profile on the line above your function declaration and run the profiler with kernprof, it will check line by line the time it took for that line to execute and also give you a percentage of the total function execution time. You obviously have to call that function in your "if name == main" so that it will execute. I recommend using very big datasets taken from the tests so you have better accuracy.
Check this line profiler, you will find all the information you need on this page.
Have a nice day!