Consider the following pandas dataframe:
In [114]:
df[\'movie_title\'].head()
Out[114]:
0 Toy Story (1995)
1 GoldenEye (1995)
2 Four Rooms (1
You should assign text group(s) with () like below to capture specific part of it.
new_df['just_movie_titles'] = df['movie_title'].str.extract('(.+?) \(')
new_df['just_movie_titles']
pandas.core.strings.StringMethods.extract
StringMethods.extract(pat, flags=0, **kwargs)
Find groups in each string using passed regular expression