Hi folks,
I am a Python newbie and using it for scientific computation...due to its supposed efficiency I am trying to use Numarray (after trying scipy and seeing how week was the documantation for that)
I didn't manage to find a function grabbing a matrix from a file into a 2d array..except for particulat data file (FITS,netCDF)...would you have any idea on how to do that? (for now i am just reading the file and splitting on spaces to get it into the array but I doubt it is the most powerfull manner... )
Also, I want to sort a 1d float array in descending order./..I have managed to do that on a list that way...
def descendingCmp(a,b):
return - cmp(a,b)
...
li.sort(descendingCmp)
but not on an array...any ideas?
Any help would be grately appreciated! Thanks and Happy New Year!!!!
I am a Python newbie and using it for scientific computation...due to its supposed efficiency I am trying to use Numarray (after trying scipy and seeing how week was the documantation for that)
I didn't manage to find a function grabbing a matrix from a file into a 2d array..except for particulat data file (FITS,netCDF)...would you have any idea on how to do that? (for now i am just reading the file and splitting on spaces to get it into the array but I doubt it is the most powerfull manner... )
Also, I want to sort a 1d float array in descending order./..I have managed to do that on a list that way...
def descendingCmp(a,b):
return - cmp(a,b)
...
li.sort(descendingCmp)
but not on an array...any ideas?
Any help would be grately appreciated! Thanks and Happy New Year!!!!