On Wed, Oct 29, 2014 at 2:16 AM, Sebastian Berg <sebast...@sipsolutions.net> wrote:
> On Di, 2014-10-28 at 14:03 -0400, Alan G Isaac wrote: > I don't really like flat (it is a pretty old part of numpy), but I > agree, while you can force nditer to be C-contiguous, nditer has its own > problems and is also pretty complex. I would argue that nditer it is a > "you know what you are doing" type of function... Or of course if you > want to understand the C-Api. > Unless you keep in mind how buffers are copied around inside it, using > half its features is dangerous. > One other subtle way in which nditer and falt differ is that nditer returns 0-dimensional arrays, not scalars. It turns out there is actually no way in numpy to iterate in the fastest possible order ('K') over an N-dimensional array in Python without the overhead of creating 0-dimensional arrays. This came up recently an as issue for numba: https://github.com/numba/numba/issues/841 So although this discussion has mostly been about consolidating options, this is at least one feature that we might like to add. Honestly, this is likely only to be an issue for projects like Numba that take valid python/numpy code and compile it. If you're writing C/Cython, you can just use the NumPy C API. Cheers, Stephan
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion