jjzjj

python - 根据列值重复 pandas DataFrame 中的行

我有以下df:code.role.persons123.Janitor.3123.Analyst.2321.Vallet.2321.Auditor.5第一行表示我有3个人扮演看门人的角色。我的问题是我需要为每个人安排一行。我的df应该是这样的:df:code.role.persons123.Janitor.3123.Janitor.3123.Janitor.3123.Analyst.2123.Analyst.2321.Vallet.2321.Vallet.2321.Auditor.5321.Auditor.5321.Auditor.5321.Auditor.5321.Auditor.5