title: How to change all values of a column into unique integers?
body: <p>I'm working on a chess dataset, where I got a column for move_1, move_2, move_3 and so on...
  each of these columns has the 'play code' made by the player. Each row is for a specific game and there are about 1000 rows.</p>
  
  <pre><code>  result move_1 move_2 move_3 ...
        1     e4     d4    Nc3  ...    
        1     d4    Nf3     c4  ...
        1     e4     d3    Nd2  ...
        1     d4     c4     d5  ...
        0     d4     c4    Nc3  ...
  
  keeps going down...
  </code></pre>
  
  <p>what is the best way for me to change each unique value in each row/column to an assigned integer so I can do some analysis on it? 
  I've done the following:</p>
  
  <pre><code>chess_df['move_2'].replace(to_replace=['Nf3', 'c4', 'd3','d4', 'Nc3'],
             value= [3, 2, 4, 1, 7],
             inplace=True)
  </code></pre>
  
  <p>where each 'play code' has it's assigned integer. So, 'd4' = 1, 'c4 = 2 and so on,  <strong>on ALL rows</strong>.</p>
  
  <p>Problem is, this is NOT a great way of doing it since I need to find each and every unique code and replace it for a unique integer by columns... This will take ages, and it will be really confusing.</p>
  
  <p>What I want is, move_1 column got 1000 rows and 45 unique 'play codes'. So each play code in it would become a number ranging from 1-45. </p>
  
  <p>move_2 column has 1000 rows with 89 unique values where 25 of them are also in move_1 column. So I need to assign the 25 numbers already assigned in move_1 column + 64 <strong>new</strong> numbers. And so on...</p>
  
  <p>So my question is:</p>
  
  <p>How can I through <strong>Python</strong> code, create something that would automate the process of changing the 'play code' into a unique integer on <strong>all rows and columns?</strong></p>