Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas replace word begins with contains

df['sport'] = df.sport.str.replace(r'(^.*ball.*$)', 'ball sport')
df
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #replace #word #begins
ADD COMMENT
Topic
Name
4+6 =