错误信息: ValueError: DataFrame index must be unique for orient='columns'
官网解释: pandas.pydata.org/pandas-docs…
我的解决:ret.to_json(orient="split")
jso格式如下 行列索引和数据分为3个dict 对应的value为list 其中data为二维
{
"columns": [
"2021-03-31",
"2020-12-31",
...
"2015-03-31",
"2021-06-30"
],
"index": [
"总资产净利润率",
"现金周期",
"流动资产周转率",
"总资产周转率",
...],
"data": [
[
0.0096652355,
-0.8293684813,
-5.4261097763,
0.1362314567,
0.0055063438,
0.0435877893,
-0.299344604,
...
],
[
509.4200002625,
576.980000113,
1809.5799991314,
956.8100006403,
683.0100002288,
651.5400001291,
...
]]
dataframe数据 如下