1
我有一個Pandas
Dataframe
或兩行數據,我想作爲JSON
陣列通過。熊貓數據幀轉換爲JSON
[{
"Date": "2017-02-03",
"Text": "Sample Text1"
},
{
"Date": "2015-02-04",
"Text": "Sample Text2"
}]
我試着用df.to_json(orient='index')
,但輸出是不完全正確,因爲它似乎是使用index
值keys
{"0":{"Date":"2017-02-03","Text""Sample Text1"},"1":{"Date":"2017-02-04","Text""Sample Text2"}}