📜  将数据帧转换为 json - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:11.706000             🧑  作者: Mango

代码示例2
dictionary_varibale = [ 
    dict([
        (colname, row[i]) 
        for i,colname in enumerate(df.columns)
    ])
    for row in df.values
]
print(json.dumps(dictionary_varibale))