I am working with a JSON file containing movie data and I'm looking to extract only the top ten highest scoring movies:
Here is a snippet of the data:
{
"movies" : {
"eraserhead" : {
"full_title" : "Eraserhead",
"votes": 50
},
"psycho" : {
"full_title" : "Psycho",
"votes" : 90
}
}
}
And so on for approximately 50-100 entries.
While I am aware that I can iterate through the data and create a list based on the scores, I am interested in knowing if there is a more efficient way to filter and retrieve the top ten movies based on the movies[title].votes
property.
Any suggestions or guidance on this matter would be highly appreciated. Thank you.