【发布时间】:2026-02-05 05:30:01
【问题描述】:
所以我的输入是:
Col1 Col2 Col3 Col4
0 123 abc,def,ghi Country1 XXX
1 456 pqr,stu Country2 XX
2 789 xyz Country2 YY
我希望我的输出为:
Col1 Col2 Col3 Col4
0 abc 123 Country1 XXX
1 def 123 Country1 XXX
2 ghi 123 Country1 XXX
3 pqr 456 Country2 XX
4 stu 456 Country2 XX
5 xyz 789 Country2 YY
请问最pythonic的方法是什么?谢谢vm!
【问题讨论】:
标签: python pandas dataframe multiple-columns data-manipulation