1In [71]:
2df.loc[df['sport'].str.contains('ball'), 'sport'] = 'ball sport'
3df
4
5Out[71]:
6 name sport
70 Bob tennis
81 Jane ball sport
92 Alice ball sport
1df.sport.str.replace(r'(^.*ball.*$)', 'ball sport')
2
30 tennis
41 ball sport
52 ball sport
6Name: sport, dtype: object