【问题标题】:Dict to DataFrame: Value instead of list in DataFrame字典到 DataFrame:DataFrame 中的值而不是列表
【发布时间】:2022-12-04 00:57:16
【问题描述】:

当我将字典转换为数据框时,我如何停止列表中的每个值。

我试着用 pandas from_dict 转换

【问题讨论】:

    标签: python pandas dataframe


    【解决方案1】:

    您可以使用orient='records'

    all_kpi.to_dict(orient='records')
    

    查看pandas documentation了解不同的方向。

    【讨论】:

      猜你喜欢
      • 2015-04-02
      • 2019-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-15
      • 2019-07-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多