find and replace string dataframe
df['range'] = df['range'].str.replace(',','-')
find and replace string dataframe
df['range'] = df['range'].str.replace(',','-')
replace string if it contains a substring pandas
df_a.loc[df_a.categories.str.contains('beverage'), 'categories'] = 'beverage'
categories product_name
0 beverage coca-cola
1 salty snacks salted pistachios
2 beverage fruit juice
3 beverage lemon tea
4 salty crackers roasted peanuts
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us