I am new to Python and a I need to performe some calculations using the package Scipy.
I installed Scipy (0.14) from synaptic and implemented the desired code.
Everything worked well.
Now, I realized that I need to download a newer version of the source code (more precisely, https:// github.com/ scipy/scipy/blob/master/scipy/optimize/ slsqp.py) and modify it before performing the calculations.
How can I use the modified code without changing the installed version?
It follows a simple version of the problem I need to solve
I installed Scipy (0.14) from synaptic and implemented the desired code.
Everything worked well.
Now, I realized that I need to download a newer version of the source code (more precisely, https:// github.com/ scipy/scipy/blob/master/scipy/optimize/ slsqp.py) and modify it before performing the calculations.
How can I use the modified code without changing the installed version?
It follows a simple version of the problem I need to solve
import numpy as np
import scipy
from scipy.optimize import minimize # here I need to insert the modified code
#######################
def blackbox(x):
fit = 0
for val in x:
fit = fit + val*val
return fit
#######################
x0=[1,1]
print scipy.__version__
res = minimize(blackbox, x0, method='SLSQP', options={'disp': True, 'maxiter':10, 'eps': 0.01, 'ftol': 1e-05})
print(res.x)
