I have a dictionary like the following:
sample_dict = {
"matchings": [
{
"indices": [
0,
1,
2
],
"geometry": "hemo_Ab}gueC????",
"matched_points": [
[
-33.823845,
-70.619614
],
[
-33.823845,
-70.619614
],
[
-33.823845,
-70.619614
]
]
}
]
}
How can I update the geometry value?
You can loop through your matchings
with this syntax:
for i, matching in enumerate(sample_json['matchings']):
# i is your matching's index
# matching is your current matching object
my_new_value = 'something'
sample_json["matchings"][i]["geometry"] = my_new_value
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments