基于字符串 - 熊猫的新行。 Python
我有这个熊猫DF,
show_id type title director cast
s1 Movie Duck the Halls Dave Wasson Chris Diamantopoulos, Tony Anselmo,
Tress MacNeille, Bill Farmer,
我需要能够以几行分解“铸造”字段 示例:
show_id type title director cast
s1 Movie Duck the Halls Dave Wasson Chris Diamantopoulos
s1 Movie Duck the Halls Dave Wasson Tony Anselmo
s1 Movie Duck the Halls Dave Wasson Tress MacNeille
s1 Movie Duck the Halls Dave Wasson Bill Farmer
我知道我应该和大熊猫一起做,但是这很复杂,您能帮我吗?
I have this pandas df
show_id type title director cast
s1 Movie Duck the Halls Dave Wasson Chris Diamantopoulos, Tony Anselmo,
Tress MacNeille, Bill Farmer,
I need to be able to break down the 'cast'' field in such a way that it is in several rows
Example:
show_id type title director cast
s1 Movie Duck the Halls Dave Wasson Chris Diamantopoulos
s1 Movie Duck the Halls Dave Wasson Tony Anselmo
s1 Movie Duck the Halls Dave Wasson Tress MacNeille
s1 Movie Duck the Halls Dave Wasson Bill Farmer
I understand that I should do it with pandas, but it is very complicated, can you help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用吐痰并爆炸:
You can use spit and explode:
您可以使用:
You can use: