{
"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
}
}
}
I would like to load the above json into a pandas dataframe and make both is_available and variable column names, so eventual structure looks like so:
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
currently, I do this:
pd.read_json(json)