【发布时间】:2014-09-17 21:06:38
【问题描述】:
我有一个名为“Stories”的 DF,如下所示:
Story
The Man
The Man Child
The Boy of Egypt
The Legend of Zelda
有没有办法提取每个字符串中的最后一个单词?
类似:
Stories['Prefix'] = final['Story'].str.extract(r'([^ ]*)')
找到前缀,但我不确定如何相应地调整它
我希望最终得到类似的东西
Story Suffix
The Word Of Man Man
The Man of Legend Legend
The Boy of Egypt Egypt
The Legend of Zelda Zelda
任何帮助将不胜感激!
【问题讨论】:
标签: python-3.x pandas