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. string - Python Replace \\ with \ - Stack Overflow

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

  3. 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 …

  4. 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 …

  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 - Replacing a character from a certain index - Stack Overflow

    How can I replace a character in a string from a certain index? For example, I want to get the middle character from a string, like abc, and if the character is not equal to the character the user

  8. 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, …

  9. 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...

  10. python - Case insensitive replace - Stack Overflow

    May 28, 2009 · What's the easiest way to do a case-insensitive string replacement in Python?