I'm attempting to retrieve data from within a nested JSON data using Python.
Abbreviated example of the JSON data:
{
"daily" : {
"1524182400000" : 438,
"1524268800000" : 438,
"1524355200000" : 437,
"1524441600000" : 437,
"1524528000000" : 432
}
}
As you see, each of the above keys is a unix timestamp and the overall object is constantly updated with new key/value pairs.
While I am easily able to retrieve the data if I know the timestamp I don't know how I get the value of the latest timestamp.
I would usually complete this in PHP with the below code and selecting the array position:
foreach ($data["daily"] as $timedate => $value) {
array_push($ValueArray, $value);
array_push($ValueDate, $timedate);
}
How do I get this in Python?
Any help would be appreciated!