title: python pandas replacing strings in dataframe with numbers
body: <p>Is there any way to use the mapping function or something better to replace values in an entire dataframe?</p>
  <p>I only know how to perform the mapping on series.</p>
  <p>I would like to replace the strings in the 'tesst' and 'set' column with a number
  for example set = 1, test =2</p>
  <p>Here is a example of my dataset: (Original dataset is very large)</p>
  <pre><code>ds_r
    respondent  brand engine  country  aware  aware_2  aware_3  age tesst   set
  0          a  volvo      p      swe      1        0        1   23   set   set
  1          b  volvo   None      swe      0        0        1   45   set   set
  2          c    bmw      p       us      0        0        1   56  test  test
  3          d    bmw      p       us      0        1        1   43  test  test
  4          e    bmw      d  germany      1        0        1   34   set   set
  5          f   audi      d  germany      1        0        1   59   set   set
  6          g  volvo      d      swe      1        0        0   65  test   set
  7          h   audi      d      swe      1        0        0   78  test   set
  8          i  volvo      d       us      1        1        1   32   set   set
  </code></pre>
  <p>Final result should be</p>
  <pre><code> ds_r
    respondent  brand engine  country  aware  aware_2  aware_3  age  tesst  set
  0          a  volvo      p      swe      1        0        1   23      1    1
  1          b  volvo   None      swe      0        0        1   45      1    1
  2          c    bmw      p       us      0        0        1   56      2    2
  3          d    bmw      p       us      0        1        1   43      2    2
  4          e    bmw      d  germany      1        0        1   34      1    1
  5          f   audi      d  germany      1        0        1   59      1    1
  6          g  volvo      d      swe      1        0        0   65      2    1
  7          h   audi      d      swe      1        0        0   78      2    1
  8          i  volvo      d       us      1        1        1   32      1    1
  </code></pre>