I have a JSON object array as given below:
"results": [
{
"BOX_coordinate_LefTop_X": 241,
"BOX_coordinate_LefTop_Y": 1428,
"BOX_coordinate_RightBottom_X": 2081,
"BOX_coordinate_RightBottom_Y": 1738,
"BOX_language" : "English",
"OCR_possibility0": "Resident identity Card"
},
{
"BOX_coordinate_LefTop_X": 140,
"BOX_coordinate_LefTop_Y": 3272,
"BOX_coordinate_RightBottom_X": 1924,
"BOX_coordinate_RightBottom_Y": 3481,
"BOX_language" : "English",
"OCR_possibility0": "Name: Bhawandeep"
},
{
"BOX_coordinate_LefTop_X": 537,
"BOX_coordinate_LefTop_Y": 3489,
"BOX_coordinate_RightBottom_X": 1951,
"BOX_coordinate_RightBottom_Y": 3686,
"BOX_language" : "English",
"OCR_possibility0": "Bhawandeep"
},
{
"BOX_coordinate_LefTop_X": 67,
"BOX_coordinate_LefTop_Y": 3844,
"BOX_coordinate_RightBottom_X": 1580,
"BOX_coordinate_RightBottom_Y": 4091,
"BOX_language" : "English",
"OCR_possibility0": "Nationality: Indian"
}
]
I want to sort this list based on the BOX_coordinate_LefTop_Y.
results.sort(key='BOX_coordinate_LefTop_Y') is not working as expected.