我们通过以下代码查询一个df:
json.loads(df.reset_index(drop=True).to_json(orient='table'))
输出是:
{"index": [ 0, 1 ,2, 3, 4],
"col1": [ "250"],
"col2": [ "1"],
"col3": [ "223"],
"col4": [ "2020-06-12 14:55"]
}
我们需要的输出应该是这样的:
[ "250", "1", "223", "2020-06-12 14:55"],[.....][.....]