title: scipy fmin operands could not be broadcast together with shapes
body: <p>i'm trying to learn about optimization in Python so i've written some code to test out the fmin function.</p>
  
  <p>However i keep receiving the following error:</p>
  
  <pre><code>ValueError: operands could not be broadcast together with shapes (1,2) (100,)
  </code></pre>
  
  <p>I can tell the issue is to do with the dimensions of my arguments but I'm not sure how to rectify it. Rather than a lambda function I also tried to def a function but I still get the same error. </p>
  
  <p>I'm sure it's something pretty basic but I can't seem to understand it. Any help wold be greatly appreciated! </p>
  
  <pre><code>import numpy as np
  import pandas as pd
  from scipy.stats.distributions import norm
  from scipy.optimize import fmin
  
  x = np.random.normal(size=100)
  
  norm_1 = lambda theta,x: -(np.log(norm.pdf(x,theta[0],theta[1]))).sum()
  
  def norm_2(theta,x):
      mu = theta[0]
      sigma = theta[1]
      ll = np.log(norm.pdf(x,mu,sigma)).sum()
      return -ll
  
  fmin(norm_1,np.array([0,1]),x)
  
  fmin(norm_2,np.array([0,1]),x)
  </code></pre>