python - Why does %timeit loop different number of times? -
on jupter notebook, trying compare time taken between 2 methods finding index max value.
in image, first function took, 1000 loops, , second took 10000 loops, increase in loops due method or jupyter added more loops more accurate time per loop though second function maybe took 1000 only, case?
%timeit
library limit number of runs depending on how long script takes execute.
the number of runs may set -n. example:
%timeit -n 5000 df = pd.dataframe({'high':[1,4,8,4,0]}) 5000 loops, best of 3: 592 µs per loop
Comments
Post a Comment