我是python新手,我想把数据分成一列,包括电影名称和发行年份,然后分成多列,所以我找到了split函数。你知道吗
数据按标题(年份)组织。你知道吗
我在python中尝试的是:
movies['title'].str.split('(', 1, expand = True)
以下情况例外:
City of Lost Children, The (Cité des enfants perdus, La) (1999)
City of Lost Children, The. Cité des enfants perdus, La) (1999)
我所期待的是1999年)进入第二栏。你知道吗
我需要你的帮助!你知道吗
我建议
pd.Series.str.rsplit
:给定一系列
s
:使用
s.str.rsplit('(', 1, expand=True)
:我赞成在这里使用
re.findall
模式(.*?) \((\d{4})\)
:这张照片:
相关问题 更多 >
编程相关推荐