I'm currently working with Python 3 and Numpy. I have a structured array created by using numpy.genfromtxt("textfile.txt", names=True) and I want to sort the columns in alphabetical order.
The first row contains the names of the columns.
The other columns contain the accompanying values per instance.
I simply want to switch the order of the columns to the alphabetical order of the column names.
For instance, now the order of the columns is 'year', 'population', 'area' and I want it to become 'area', 'population', 'year'.
Thanks in advance for helping out!
numpy.argsort.