熊猫拆分列为多行

时间:2018-10-03 04:05:50

标签: python pandas dataframe

我正在尝试使用pandas将任意列“扩展”为多行。作为一个简单的示例,给定第2列,我将如何使用';'作为分隔符。

输入日期框架示例:

df = 
    Column_1      Column_2   Column_3
0   Placeholder   A;B        C
1   Placetodo     D;E        F

所需的输出数据帧:

df = 
    Column_1      Column_2   Column_3
0   Placeholder   A          C
1   Placeholder   B          C
2   Placetodo     D          F
3   Placetodo     E          F

任何帮助将不胜感激

0 个答案:

没有答案
相关问题