title: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.float64'
body: <p>long time reader, first time writer.</p>
  
  <p>I searched around on google and stack overflow, but wasn't really able to find a general answer to this question.</p>
  
  <p>I am getting an "unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.float64'" error in python 2.7.3 using numpy 1.6.2.</p>
  
  <p>The error comes from multiplying a numpy array and a numpy float, but it doesn't happen every time.  </p>
  
  <p>For example:</p>
  
  <pre><code>x = np.tan(1) # numpy.float64
  y = np.array([0,1,2,3]) # numpy.ndarray
  np.multiply(x,y) # works no problem
  </code></pre>
  
  <p>Or </p>
  
  <pre><code>x = np.tan(np.abs(np.multiply(-31,41)))  # numpy.float64
  y = np.square(np.add(np.divide(np.zeros(100),42),(-27)**40)) # numpy.ndarray
  np.multiply(x,y) # works no problem
  </code></pre>
  
  <p>Both work</p>
  
  <p>Now for the problem children:</p>
  
  <pre><code>np.multiply(np.square(np.add(np.divide(np.zeros(100),42),-27)**40)),
  np.tan(np.abs(np.multiply(-31,41))))
  </code></pre>
  
  <p>or, with x defined as above:</p>
  
  <pre><code>np.multiply(np.square(np.add(np.divide(np.zeros(100),42),(-27)**40)),x)
  </code></pre>
  
  <p>both produce the error: NotImplemented</p>
  
  <p>I know the random functions and numbers seem odd, but conceptually this still should work, as it worked when both were set to variables individually.</p>
  
  <p>Why does this happen?  How can I fix it in a general sense?</p>
  
  <p>Thanks so much!
  Jason</p>