title: How to use scipy.optimize minimize_scalar when objective function has multiple arguments?
body: <p>I have a function of multiple arguments. I want to optimize it with respect to a single variable while holding others constant. For that I want to use minimize_scalar from spicy.optimize. I read the documentation, but I am still confused how to tell minimize_scalar that I want to minimize with respect to variable:w1. Below is a minimal working code.</p>
  
  <pre><code>import numpy as np
  from scipy.optimize import minimize_scalar
  
  def error(w0,w1,x,y_actual):
      y_pred = w0+w1*x
      mse = ((y_actual-y_pred)**2).mean()
      return mse
  
  w0=50
  x = np.array([1,2,3])
  y = np.array([52,54,56])
  minimize_scalar(error,args=(w0,x,y),bounds=(-5,5))
  </code></pre>