nameta9
- 184
- 0
No numerical sort in python ?
I was really surprised to see that python can't do such an elementary operation!
I am trying to do a numerical sort in python on an array. I am using python for windows (DOS). In perl you can simply write sort{$a<=>$b}@a and this will sort it according to the value of the numerical string, (not the alphabetical value). I am looking for something similar in python but could only find a reference to sourceforge numpy where I have to download a large piece of source code in C and recompile it locally. Is there a simpler solution ? thanks...
I was really surprised to see that python can't do such an elementary operation!
I am trying to do a numerical sort in python on an array. I am using python for windows (DOS). In perl you can simply write sort{$a<=>$b}@a and this will sort it according to the value of the numerical string, (not the alphabetical value). I am looking for something similar in python but could only find a reference to sourceforge numpy where I have to download a large piece of source code in C and recompile it locally. Is there a simpler solution ? thanks...
Last edited: