If I have a dictionary of arrays, for example:
samples = {
"labels": ["A", "B", "C"],
"values": [2, 3, 1]
}
How do I sort the lists by the value order? For example, the output would be:
samples = {
"labels": ["C", "A", "B"],
"values": [1, 2, 3]
}
Would I need to convert the dictionary of lists into a list of dictionaries, sort by the values, then convert back, or is there a more direct way?