title: comparing values in numpy array of n-dimension
body: <p>Need to compare each value inside a numpy array and return 1 to the largest value and 0 to the others. I am having problem with different numbers of [].</p>
  
  <p>Input Example:</p>
  
  <pre><code>[[[0.6673975 0.33333233]]
  .
  .
  .
  [[0.33260247 0.6673975]]]
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>[[[1 0]]
  .
  .
  .
  [[0 1]]]
  </code></pre>