python - Why does %timeit loop different number of times? -


on jupter notebook, trying compare time taken between 2 methods finding index max value.

enter image description here

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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -