I have a list of strings of the form:
my_list=['i99_W_t10', 'i99_M_t11', 'i94_M_t12', 'i93_W_t2', ..., 'i14_M_t19']
(so always 3 fields sepparated by _. I would like to sort this list first by the 2nd element, then the 3rd and then the 1st. So the list above would become:
my_list=['i99_M_t11', 'i94_M_t12', 'i14_M_t19', 'i93_W_t2', 'i99_W_t10', ... ]
I know how to do this by turning the list into a pandas dataframe, splitting fields into columns, sorting them, and returning the sorted list. But perhaps there is a more elegant way done directly on the list instead of having to go for dataframes?