code: def test_replace_commutative(self, ser, to_replace, exp):
      # GH 16051
      # DataFrame.replace() overwrites when values are non-numeric
  
      series = pd.Series(ser)
  
      expected = pd.Series(exp)
      result = series.replace(to_replace)
  
      tm.assert_series_equal(result, expected)
  
imports: import re
  import numpy
  import pytest
  from pandas._config import using_pyarrow_string_dtype
  import pandas
  import pandas._testing
  from pandas.core.arrays import IntervalArray
label_desc: Use image node_id 29 for calling the TestSeriesReplace obj's underlying member method code with example usage: obj.test_replace_commutative(ser, to_replace, exp) without return types