Is there any way to convert a pandas dataframe into a json with different levels, I have this dataframe:
df = pd.DataFrame([
{"type":"Feature","Id":319,"Departament":"1 DE MAYO","State":"CHACO","coordinates":[[[-58.95370956800002, -26.87059472200002]]]},
{"type":"Feature","Id":320,"Departament":"12 DE OCTUBRE","State":"CHACO","coordinates":[[[-58.95370956800002, -26.87059472200002]]]},
{"type":"Feature","Id":314,"Departament":"2 DE ABRIL","State":"CHACO","coordinates":[[[-58.95370956800002, -26.87059472200002]]]},
{"type":"Feature","Id":308,"Departament":"25 DE MAYO","State":"CHACO","coordinates":[[[-58.95370956800002, -26.87059472200002]]]},
{"type":"Feature","Id":100,"Departament":"25 DE MAYO","State":"CHACO","coordinates":[[[-58.95370956800002, -26.87059472200002]]]}])
I really want an output like so:
"features": [
{
"type": "Feature",
"properties": {
"id": 319,
"Departament": "1 DE MAYO",
"State": "CHACO"
},
"geometry": {
"coordinates": [
[
[
-58.32487869300002,
-30.838373183999977
]
]
]
}
}
]
}
Thanks for your help i hope i was clear.