title: numpy replace a value by a negative int
body: <p>I am doing a game of tic tac toe as an exercise. I am trying to replace X with 3, O with -3 and - with 0.</p>
  
  <pre><code>import numpy as np
  
  playfield = np.array([
     ['X', 'O', 'X'],
     ['-', 'X', 'O'],
     ['-', '-', 'X']
  ])
  codes = {'X': 3, 'O': -3, '-': 0}
  
  for idx, x in np.ndenumerate(playfield):
  
      playfield[idx] = codes[x]
  </code></pre>
  
  <p>However, every time the program tries to replace an O by -3, my array is like this</p>
  
  <pre><code>[['3' '-' 'X']
   ['-' 'X' 'O']
   ['-' '-' 'X']]
  </code></pre>
  
  <p>It happens even if I try to replace it by -9. Also, when I try to replace '_' by -3, it appears as '-' in the array</p>
  
  <p>If I make playfield as a normal list, replace everything and make it back as a np.array, everything works. Why is it happening? Thank you!</p>