[SciPy-user] change array index order

BK lists at benair.net
Mon Mar 3 11:54:08 EST 2008


Hi everybody,

I am still kind of a newbie but I've been using scipy for some time now
for post-processing of CFD surface ASCII data. Over the time I wrote
myself a bunch of small tools doing this and that. Lately there was a
version change in the CFD code I am using and the output format changed
slightly. 
Old format was I,J-grid data with N variables in the order N,I,J (N
being the fastet running index). The new data format uses I,J,N ordering
(with I running fastest). 
So, is there a way to tell scipy to somehow 'map' one index direction to
another one, like:
	data_new[n,j,i] -> data_old[j,i,n]
without copying all the data? 

This way I could just change my IO routine and keep all the other tools
unchanged. And I could easily handle new and old version of output
files.

I suspect this is a real newbie-question, but so far I haven't been able
to figure it out myself. 

Thanks for your help, and thanks for that great toos scipy!

Best regards
Bene




More information about the SciPy-User mailing list