Re: [Numpy-discussion] Numpy/Fortran puzzle (?)

2014-08-21 Thread Xavier Barthelemy
Hi Andrea You should add a dimension argument in your Fortran code, also you should write a f2py header in the same Fortran code. Remember, numpy memory is C order wise. You can specify in numpy the ordering of the matrices you pass when you create them. F2py automatically deals with matrices , but

[Numpy-discussion] Numpy/Fortran puzzle (?)

2014-08-20 Thread Andrea Gavana
Hi All, I have the following (very ugly) line of code: all_results = np.asarray([transm_hist[date_idx, :, idx_main_set[date_idx] ]*main_flow[date_idx, 0:n_fluids] for date_idx in xrange(n_dates)]) where transm_hist.shape = (n_dates, n_fluids, n_nodes), main_flow.shape = (n_dates, n_fluids) a