title: How to reverse the process of np.flatten() and mapping?
body: <p>I have a target value numpy array with this format, lets say 10 dimensions (24,10)</p>
  
  <pre><code>Target = [[ 2,  0,  2,  0,  0,  3,  0,  0,  1,  0,  0, -2,  4, -2,  0,  0,
      -3, -3, -5,  1,  0,  0,  0,  2],...]
  </code></pre>
  
  <p>So I applied this map</p>
  
  <pre><code>checker_presence = {
  5: np.array([1,1,1,1,1], dtype=int),
  4: np.array([1,1,1,1,0], dtype=int),
  3: np.array([1,1,1,0,0], dtype=int),
  2: np.array([1,1,0,0,0], dtype=int),
  1: np.array([1,0,0,0,0], dtype=int),
  0: np.array([0,0,0,0,0], dtype=int),
  -1: np.array([-1,0,0,0,0], dtype=int),
  -2: np.array([-1,-1,0,0,0], dtype=int),
  -3: np.array([-1,-1,-1,0,0], dtype=int),
  -4: np.array([-1,-1,-1,-1,0], dtype=int),
  -5: np.array([-1,-1,-1,-1,-1], dtype=int)}
  
  labels_ = np.array([list(map(checker_presence.__getitem__, row)) for row in target])
  </code></pre>
  
  <p>And the target value is now (10,24,5):</p>
  
  <pre><code>  [[ 1,  1,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 1,  1,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 1,  1,  1,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 1,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [-1, -1,  0,  0,  0],
     [ 1,  1,  1,  1,  0],
     [-1, -1,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [-1, -1, -1,  0,  0],
     [-1, -1, -1,  0,  0],
     [-1, -1, -1, -1, -1],
     [ 1,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 0,  0,  0,  0,  0],
     [ 1,  1,  0,  0,  0]],...]
  </code></pre>
  
  <p>After this I applied a flatten function to be only one single array (10,120):</p>
  
  <pre><code>labels = np.array([i.flatten() for i in labels_])
  [ 1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,
      0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  0,  0,  0,  0,  0,  0,
      0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
      0,  0,  0,  0, -1, -1,  0,  0,  0,  1,  1,  1,  1,  0, -1, -1,  0,
      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1, -1,  0,  0,
     -1, -1, -1,  0,  0, -1, -1, -1, -1, -1,  1,  0,  0,  0,  0,  0,  0,
      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,
      0],...]
  </code></pre>
  
  <p>My question is how I can reverse this process to my target value be the original </p>
  
  <pre><code>[ 2,  0,  2,  0,  0,  3,  0,  0,  1,  0,  0, -2,  4, -2,  0,  0,
  -3, -3, -5,  1,  0,  0,  0,  2]
  </code></pre>
  
  <p>In this example I only use one row to better understanding. The problem is that I needed do this transformations for my neural network, but to analyze the predict, I need reverse the process.</p>