title: Pandas replace dataframe value with a variable at a variable row
body: <p>I want to replace a row in a csv file with a variable. The row itself also has to be a variable. The following code is an example:</p>
  <pre><code>import pandas as pd
  
  # sample dataframe
  df = pd.DataFrame({'A': ['a','b','c'], 'B':['b','c','d']})
  print(&quot;Original DataFrame:\n&quot;, df)
  
  x = 1
  y = 12698
  
  df_rep = df.replace([int(x),1], y)
  print(&quot;\nAfter replacing:\n&quot;, df_rep)
  </code></pre>