title: Replace values in pandas dataframe - changed functionality?
body: <p>I am looking at the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.replace.html" rel="nofollow noreferrer">pandas documentation</a> about how to replace values in a data frame. I am copy and pasting the code directly from the documentation to do so, and it doesn't work.</p>
  
  <pre><code>df = pd.DataFrame({'A': ['bat', 'foo', 'bait'],
                 'B': ['abc', 'bar', 'xyz']})
  
  print(df)
  
  Result:
       A    B
  0   bat  abc
  1   foo  bar
  2  bait  xyz
  
  df.replace(to_replace=r'^ba.$', value='new', regex=True)
  
  Result:
        A    B
  0   bat  abc
  1   foo  bar
  2  bait  xyz
  </code></pre>
  
  <p>Has some functionality changed?</p>