📜  数据帧分组到字典 - Python 代码示例

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

代码示例3
In [433]: {k: list(v) for k, v in df.groupby('Column1')['Column3']}
Out[433]: {0: [1], 1: [2, 3, 5], 2: [1, 2], 3: [4, 5], 4: [1], 5: [1, 2, 3]}