如何在Python中重塑数据

问题描述

我有一个仅包含一行但多列的数据框:

enter image description here

我想将每5列放到新行中。这是预期的输出:

enter image description here

原始数据在列表中,我转换为数据框。我不知道通过列表重塑是否更容易,但是这里有一个示例列表供您试用,原始列表确实很长。 ['review: I stayed around 11 days and enjoyed stay very much.','compound: 0.5106,','neg: 0.0,'neu: 0.708,'pos: 0.292,'review: Plans for weekend stay canceled due to Coronavirus shutdown.','compound: 0.0,'neu: 1.0,'pos: 0.0,']

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)