About 6,270,000 results
Open links in new tab
  1. How to use string.replace() in python 3.x - Stack Overflow

    Feb 26, 2012 · The string.replace() is deprecated on python 3.x. What is the new way of doing this?

  2. python - How to replace multiple substrings of a string ... - Stack ...

    After some benchmarking on using replace several times vs regex replacement on a string of increasing length by power of 2 with 100 replacements added, it seems that on my computer …

  3. python .replace () regex - Stack Overflow

    118 In order to replace text using regular expression use the re.sub function: sub (pattern, repl, string [, count, flags]) It will replace non-everlaping instances of pattern by the text passed as …

  4. string - Python Replace \\ with \ - Stack Overflow

    Mar 3, 2015 · Python Replace \\ with \ [duplicate] Asked 14 years, 8 months ago Modified 3 years, 5 months ago Viewed 200k times

  5. python - How to replace/overwrite file contents instead of …

    When you say "replace the old content that's in the file with the new content", you need to read in and transform the current contents data = file.read(). You don't mean "blindly overwrite it …

  6. python - How to replace text in a string column of a Pandas …

    If you only need to replace characters in one specific column, somehow regex=True and in place=True all failed, I think this way will work: data["column_name"] = …

  7. python - How to search and replace text in a file - Stack Overflow

    How do I search and replace text in a file using Python 3? Here is my code: import os import sys import fileinput print ("Text to search for:") textToSearch = input ("> ") pr...

  8. Right-to-left string replace in Python? - Stack Overflow

    May 14, 2020 · I wonder why didn't python teams write a specific method to replace strings from right to left?

  9. python - How to replace NaN values in a dataframe column

    On the other hand, replace() (another method given on this page) is a numpy.putmask operation (source). Because numexpr is a faster than numpy for large arrays, for very large dataframes, …

  10. Replace all newline characters using python - Stack Overflow

    Feb 19, 2019 · I am trying to read a pdf using python and the content has many newline (crlf) characters. I tried removing them using below code: from tika import parser filename = …