jupyter notebook
python3
在测一个功能的实现效率,得到这么几个结果:
123 ms ± 8.32 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
59.2 ms ± 4.05 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
52.4 ns ± 0.256 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
47.4 ns ± 0.105 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
哪个耗时最短(效率最高)?
为什么?
1个回答
最下面那个最快吧,47.4 ns x 10000000 < 52.4 ns x 10000000 < 59.2 ms x 10 < 123 ms x 10
SofaSofa数据科学社区DS面试题库 DS面经