On Thu, Jul 7, 2011 at 7:24 AM, Yoshi Rokuko <[email protected]> wrote:
> thank you for pointing that out! > > so how do you change your numpy related c code now, would you like to > share? > > Either you have to deal with the axes in the c-code -- cython is an option there -- or you can check and make a copy of the array to be sure that it is both contiguous and in c-order. In [18]: a = np.ones((2,2)) In [19]: a.strides Out[19]: (16, 8) In [20]: a.T.strides Out[20]: (8, 16) In [21]: ascontiguousarray(a.T).strides Out[21]: (16, 8) Strictly speaking, you should have been doing that anyway, but sometimes quick and dirty gets the job done ;) Chuck
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
