Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def my_function(x,a, c):
- return a/x + c
- params = {
- 'figure.figsize': [15, 10]
- }
- plt.rcParams.update(params)
- ax = plt.subplot(111)
- ax.spines["top"].set_visible(False)
- ax.spines["right"].set_visible(False)
- angle, inte = sp.loadtxt("Current.csv", skiprows=10, unpack=1, delimiter=',')
- err_angle = 1
- # Our initial guess for the parameters
- guess_a=2
- guess_c=1
- p0=[guess_a, guess_c]# Array that of initial parameter values
- fit = curve_fit(my_function, x, y, p0=p0)
- x=sp.arange(0.3,7,0.001)
- data_fit = my_function(x, *fit[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement