I am trying to understand how nditer(ops, order='K') handles C and F order. In the documentation it states
"‘K’ means as close to the order the array elements appear in memory as possible"
but I seem to be getting inconsistent results (numpy 1.9):

    >>> a = np.array([[1, 2], [3, 4]], order="C")
    >>> b = np.array([[1, 2], [3, 4]], order="F")
    >>> [v for v in np.nditer([a], order='K')]

    [array(1), array(2), array(3), array(4)]

    >>> [v for v in np.nditer([b], order='K')]
    [array(1), array(3), array(2), array(4)]
    >>> [v for v in np.nditer([a,b], order='K')]
    [(array(1), array(1)), (array(2), array(2)), (array(3), array(3)), (array(4), array(4))]

The result for np.nditer([b], order='K') seems to be wrong. Could someone confirm this is an issue or explain what is going on?

Matti
_______________________________________________
NumPy-Discussion mailing list
[email protected]
https://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to