Pandas将(不等长)列表的列拆分为多列

问题描述 投票:0回答:1

这个问题略有不同:Pandas split column of lists into multiple columns

给定一个数据帧:

col1
[0, 1, 2]
[0, 1]
[0, 1, 2, 3, 4, 5, 6]
[0, 1, 2, 3]

如何将其转换为具有等于最大长度的列的数据帧?

col1 col2 col3 col4 col5 col6 col7
0    1    2 
0    1 
0    1    2    3    4    5    6
0    1    2    3 
python pandas
1个回答
1
投票

使用qazxsw poi qazxsw poi重新创建你qazxsw poi

pandas
© www.soinside.com 2019 - 2024. All rights reserved.