1
{
"type_a": {
"2015-08-07": {
"is_available": false,
"variable": 0.282
},
"2015-08-23": {
"is_available": false,
"variable": 0.296
},
"2017-03-28": {
"is_available": false,
"variable": 0.524
}
},
"type_b": {
"2015-06-27": {
"is_available": true,
"variable": 0.038
},
"2015-07-30": {
"is_available": true,
"variable": 0.035
},
"2017-04-27": {
"is_available": true,
"variable": 0.158
}
}
}
Ich mag würde die oben json in eine Pandas Datenrahmen und machen beide is_available
und variable
Spaltennamen laden, so dass eventuelle Struktur sieht so aus:Parsing json in Pandas Datenrahmen
data_source is_available variable
2015-08-07 type_a false 0.282
2015-08-23 type_a false 0.296
2017-03-28 type_a false 0.524
2015-06-27 type_b true 0.038
2015-07-30 type_b true 0.035
2015-04-27 type_b true 0.158
zur Zeit, ich tun dies:
pd.read_json(json)
Bricht es nicht auf die Verwendung von True und False? Weil das keine Python-Syntax ist – TLOwater