I have the following doubly-nested list:
records = [[['Jack', 'male', 1],['Jack', 'male', 2],['Jack', 'male', 3]],[['Sally', 'female', 1],['Sally', 'female', 2],['Sally', 'female', 3]]]
I want to sort this list according to this list...
list_order = ['female', 'male']
...such that the result is this:
records
[[['Sally', 'female', 1],['Sally', 'female', 2],['Sally', 'female', 3]],[['Jack', 'male', 1],['Jack', 'male', 2],['Jack', 'male', 3]]]