January 2018
Beginner to intermediate
548 pages
12h 11m
English
In this short recipe, we will see how to use SciPy to find the root of a simple mathematical function of a single real variable.
scipy.optimize, and matplotlib:>>> import numpy as np
import scipy as sp
import scipy.optimize as opt
import matplotlib.pyplot as plt
%matplotlib inline>>> def f(x):
return np.cos(x) - x>>> x = np.linspace(-5, ...
Read now
Unlock full access