Guest User

Untitled

a guest
Mar 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. test_string = str('19631 location android location you enter an area enable quick action honeywell singldzone thermostat environment control and monitoring')
  2. print(test_string)
  3.  
  4. test_string = test_string.replace('singl\dzone ','singl_dbl_zone ')
  5. print(test_string)
  6.  
  7. 19631 location android location you enter an area enable quick action honeywell singldzone thermostat environment control and monitoring
  8. 19631 location android location you enter an area enable quick action honeywell singl_dbl_zone thermostat environment control and monitoring
  9.  
  10. raw_corpus.loc[:,'constructed_recipe']=raw_corpus['constructed_recipe'].str.replace('singl\dzone ','singl_dbl_zone ')
  11.  
  12. 323096 you enter an area android location location environment control and monitoring honeywell singldzone thermostat enable quick action
  13.  
  14. df['col'] = df['col'].str.replace(r'\d', '_dbl_')
  15.  
  16. In [165]: df
  17. Out[165]:
  18. constructed_recipe
  19. 0 singldzone
  20.  
  21. In [166]: df['constructed_recipe'] = df['constructed_recipe'].str.replace(r'\', '')
  22.  
  23. In [167]: df
  24. Out[167]:
  25. constructed_recipe
  26. 0 singldzone
Add Comment
Please, Sign In to add comment