title: loop of ufunc does not support argument 0 of type float which has no callable exp method, in some cases
body: <p>When I give following command it works:</p>
  <pre><code>W2 = np.array( [[ 0.00874286,-0.01293537,-0.00079741,0.00564486,0.01233471]])
  b2=np.array([[0.]])
  a=np.array([[11.2,11.0,12.7],[10.1,34.4,4.0],[9.0,7.9,6.6],[8.5,8.0,9.45,],[5.5,9.9,8.3]])
  
  Z = np.dot(W2,a)+b2
  print(1/(1+np.exp(-Z)))
  </code></pre>
  <p><strong>Output is:</strong></p>
  <pre><code>[[0.51897047 0.4531795  0.55224658]]
  </code></pre>
  <p>but when I give it following it generates error:</p>
  <pre><code>Z = np.dot(parameters['W2'],A)+parameters['b2']
  print(1/(1+np.exp(-Z)))
  </code></pre>
  <p>where <strong>A, parameters['W2], parameters['b2']</strong> are numpy array and have float values.
  <strong>Output is:</strong></p>
  <pre><code>AttributeError                            Traceback (most recent call last)
  AttributeError: 'float' object has no attribute 'exp'
  
  The above exception was the direct cause of the following exception:
  
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-26-dc868b05af37&gt; in &lt;module&gt;()
        3 Z = np.dot(parameters['W2'],A)+parameters['b2']
        4 #A1,C=linear_sigmoid_forward(A, parameters['W2'],parameters['b2'])
  ----&gt; 5 print(1/(1+np.exp(-Z)))
  
  TypeError: loop of ufunc does not support argument 0 of type float which has no callable exp method
  </code></pre>
  <p>In Both cases I've given float numpy arrays, but it generates error in second case. Why???</p>