我有一个输入数据框,它包含以下内容:
NAME TEXT
Tim Tim Wagner is a teacher.
Tim He is from Cleveland, Ohio.
Frank Frank is a musician.
Tim He like to travel with his family
Frank He is a performing artist who plays the cello.
Frank He performed at the Carnegie Hall last year.
Frank It was fantastic listening to him.
如果名称列的连续行具有相同的值,我希望连接文本列
输出数据帧:
NAME TEXT
Tim Tim Wagner is a teacher. He is from Cleveland, Ohio.
Frank Frank is a musician
Tim He like to travel with his family
Frank He is a performing artist who plays the cello. He performed at the Carnegie Hall last year. It was fantastic listening to him.
使用pandas shift是最好的方法吗?谢谢你的帮助
谢谢
我一行一行地创建了一个新的数据帧
尝试:
输出:
相关问题 更多 >
编程相关推荐