【发布时间】:2021-05-07 14:35:45
【问题描述】:
假设我有一个列表:
[(red, red, 1),
(red, blue, 3),
(red, yellow, 2),
(blue, red, 3),
(blue, blue, 1),
(blue, yellow, 4),
(yellow, red, 2),
(yellow, blue, 4),
(yellow, yellow, 1)]
获得这样的熊猫数据框的最简单方法是什么?
red blue yellow
red 1 3 2
blue 3 1 4
yellow 2 4 1
【问题讨论】:
标签: python pandas list dataframe