title: How to use the replace() method with keyword arguments to replace empty strings
body: <p>I tried to use <strong>pandas.DataFrame.replace()</strong> to fill empty strings in a frame via the code below.</p>
  <p>main_datasets = [train_data, test_data, alt_data1, alt_data2]</p>
  <pre><code>for data in main_datasets:
      for x in data:
          if type(x) == 'int':
              x.fillna(x.median(), inplace = True)
          elif type(x) == 'float':
              x.fillna(x.median(), inplace = True)
          else:
              x.replace(to_replace = None, value = 'N/A', inplace = True)    
  </code></pre>
  <p>However, I continue to receive the following exception, despite using characters or numbers for the keyword value and removing the keyword name:</p>
  <pre><code>TypeError: replace() takes no keyword arguments
  </code></pre>
  <p>Why is this error raised from &quot;<em><strong>value = 'N/A?'</strong></em>&quot;</p>
  <p>Here is an ad hoc sample of some fields (separated by commas):</p>
  <blockquote>
  <p>12123423,       0,           M,              Y,           120432.5</p>
  <p>12654423,       1,           F,              N,           80432.5</p>
  <p>12123423,       0,           M,              Y,           120432.5</p>
  <p>12123423,       0,           M,              Y,           120432.5</p>
  </blockquote>