Re: [f2py] f2py-users Digest, Vol 65, Issue 5

Juergen Wieferink <[email protected]>
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
Hi all,

Brandt Belson wrote:
> import testarrays
> from numpy import *
> nx = 2
> ny = 3
> a=zeros((nx,ny))
> b=zeros((nx,ny))
> a=testarrays.testarrays(a,b,nx,ny)
> print a
> print b

You create the arrays by "numpy.zeros((...))", which defaults to
row-major (C ordering).  Simply use "numpy.zeros((...), order='F')"
to get column-major arrays (Fortran ordering).  Then there should be
no need to copy and transpose the matrices.

Juergen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.