【发布时间】:2015-02-24 04:34:28
【问题描述】:
我正在编写一个 python 脚本来清理我们从 Qualtrics 收到的用于创业竞赛的 CSV 文件。
到目前为止,我已经对数据进行了切片,并使用 Pandas 将其写回到了 Excel 文件中。但是,我有一些列需要用来创建新行。 例如,对于每个团队提交,我们都有
Team Name Nb of teammates Team Leader One Team Leader Two
1 x 2 Joe Joey
2 y 1 Jack
...
我需要返回
Team Name Nb of teammates Team Leader
1 x 2 Joe
2 Joey
3 y 1 Jack
...
这是我拥有的真实数据的一个非常简化的示例,因为有更多列,但我想知道如何在 Pandas/Python 中做到这一点。
我知道Inserting Row 和Indexing: Setting with enlargement 上的这些讨论,但我不知道该怎么办。
感谢您的帮助!
【问题讨论】:
-
杨从哪里来?
-
我的坏杨无所谓