title: Python ValueError abs of an array
body: <p>I am new to python and have been unable to figure out how to fix this.  I am trying to do an iteration for each value in the array, and return the array of final values.  e is a user-input single value, while M is an array of varying length. I am trying to loop the iteration for each value of E until it closely solves Kepler's equation, M=E-e*sin(E), and then return the finished array of each E for given M.</p>
  
  <pre><code>def eccano(e, M):
     E=M
     for i in range(0,len(M)):
         while abs(E-e*sin(E)-M[i]) &gt; 10**(-4):
             E=E-((E-e*sin(E)-M[i])/(1-e*cos(E)))
     return E
  
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "ME.py", line 7, in eccano
      while abs(E-e*sin(E)-M[i]) &gt; 10**(-4):
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>
  
  <p>Any advice? Thanks!</p>