Advertisement
elena1234

how to replace many chars in Python

Nov 7th, 2022 (edited)
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | Source Code | 0 0
  1. company = re.findall('\/[A-Za-z]+\?', url)
  2. chars = ['?','/', '[',']', '\'']
  3. for i in chars:
  4.     company = str(company).replace(i, '')
  5.  
  6. #############################################
  7. titanic.survived.replace(to_replace = ['yes', 'no'], value = [1,0], inplace = True)
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement