title: column type changes while using replace method
body: <p>The replace method of dataframe is changing the type of column from object to float. Is there any way to mix the object types with np.nan and keep the column as Dtype &quot;object&quot;?</p>
  <pre><code>df = df.replace(&quot;0&quot;, np.nan)
  </code></pre>
  <p>Before:</p>
  <pre><code>&lt;class 'pandas.core.frame.DataFrame'&gt;
  RangeIndex: 109 entries, 12 to 120
  Data columns (total 5 columns):
   #   Column            Non-Null Count  Dtype 
  ---  ------            --------------  ----- 
   0   transaction_date  81 non-null     object
   1   remark            81 non-null     object
   2   withdrawal        81 non-null     object
   3   deposit           81 non-null     object
   4   balance           81 non-null     object
  dtypes: object(5)
  memory usage: 4.4+ KB
  </code></pre>
  <p>After:</p>
  <pre><code>&lt;class 'pandas.core.frame.DataFrame'&gt;
  RangeIndex: 109 entries, 12 to 120
  Data columns (total 5 columns):
   #   Column            Non-Null Count  Dtype  
  ---  ------            --------------  -----  
   0   transaction_date  81 non-null     object 
   1   remark            81 non-null     object 
   2   withdrawal        52 non-null     float64
   3   deposit           29 non-null     float64
   4   balance           80 non-null     float64
  dtypes: float64(3), object(2)
  memory usage: 4.4+ KB
  </code></pre>