title: Python alternative for MATLAB code 'min(Ar_1(Ar_1~=0))'
body: <p><strong>I want to achieve the same result with least complexity in python as <code>min(Ar(Ar~=0))</code> in MATLAB</strong> where <code>Ar</code> is a 2D numpy array.</p>
  
  <p>For those who are not familiar with MATLAB, <code>~=</code> means <code>!=</code> or <em>not equal to</em>. </p>
  
  <p><strong>Is there a function in python which returns the indexes of the elements:</strong><br></p>
  
  <p><strong>1.</strong> Whose values fulfill a condition <em>(elements which are != 0 in this case)</em> 
  <br><strong>2.</strong>
  Which can directly be used as list index input for another array? <em>(As <code>(Ar~=0)</code>'s  result is being used as an input like this <code>Ar(Ar~=0)</code></em></p>
  
  <p>Here <code>Ar~=0</code> has been used as list index input like this <code>Ar(Ar~=0)</code> and then min of the array <code>Ar(Ar~=0)</code> is being found out. In other words minimum value of the array is found out excluding the elements whose value is 0.</p>