Re:Numba: High-Performance Python with CUDA Acceleration
by nerdponx on Thursday September 21, 2017 @08:53PM
(#15308596)
You can't bake this into NumPy without a compiler or JIT. Python calls don't "know" about each other. The only way to do it would be to have a function that returns both the max and the min.
[ Parent
| on HN ]
Re:Numba: High-Performance Python with CUDA Acceleration
by taeric on Friday September 22, 2017 @10:56AM
(#15312723)
Like the sibling said, you could bake the stats into member fields to cache the values. I'm guessing it wouldn't caused any real slow down, but I can understand the concern. Would also help for repeated calls to the same stat.
Though, I would also think a general .stats method would make the most sense. It is quite often nowdays to want a lot of stats.
And again, I am not arguing that the new lib shouldn't exist. I just question that example.
Re:Numba: High-Performance Python with CUDA Acceleration
by dr_zoidberg on Thursday September 21, 2017 @09:06PM
(#15308655)
See my comment on parent, for some reasong (I think your comment was too young) I couldn't reply to you directly. As for the compiler, since Microsoft handled the MSVC For Python (2.7), or if you were using Python 3 to begin with, I haven't had any problem.