I'm a total python newbie but still search for an elegant way to solve the following task. I already searched through the forum, but I only found very particular solutions for other list problems.
I'm trying to analyze, sort and rearrange an JSON array in python. But I haven't found a working solution so far to sort the list from the lowest to the highest value entries.
this is my example list:
[{'path': 'file_abc.wav', 'val': [0.49]},
{'path': 'file_dfg.wav', 'val': [0.0]},
{'path': 'file_ejh.wav', 'val': [1.0]}]
I'd like to rearrange the input list the according to its value beginning from the lowest up to the highest:
[{'path_old': 'file_dfg.wav', 'val': [0.0]},
{'path_old': 'file_abc.wav', 'val': [0.49]},
{'path_old': 'file_ejh.wav', 'val': [1.0]}]
I would be very pleased if anybody could give me a hint how to solve this in a good way!