Answers for "replace word in dataframe if it matches"

6

find and replace string dataframe

df['range'] = df['range'].str.replace(',','-')
Posted by: Guest on March-29-2021
0

pandas replace word begins with contains

df['sport'] = df.sport.str.replace(r'(^.*ball.*$)', 'ball sport')
df
Posted by: Guest on July-01-2020

Code answers related to "replace word in dataframe if it matches"

Python Answers by Framework

Browse Popular Code Answers by Language