¡@

Home 

python Programming Glossary: np.exp

These spectrum bands used to be judged by eye, how to do it programmatically?

http://stackoverflow.com/questions/10764569/these-spectrum-bands-used-to-be-judged-by-eye-how-to-do-it-programmatically

one at t 0.4 large one at t 0.8 ts np.arange 0 1 0.01 xs np.exp ts 0.4 0.1 2 2 np.exp ts 0.8 0.1 2 # Say we have an approximate.. at t 0.8 ts np.arange 0 1 0.01 xs np.exp ts 0.4 0.1 2 2 np.exp ts 0.8 0.1 2 # Say we have an approximate starting point of..

gaussian fit with scipy.optimize.curve_fit in python with wrong results

http://stackoverflow.com/questions/14459340/gaussian-fit-with-scipy-optimize-curve-fit-in-python-with-wrong-results

function def gauss_function x a x0 sigma return a np.exp x x0 2 2 sigma 2 # program from scipy.optimize import curve_fit..

setup odes in python

http://stackoverflow.com/questions/16747624/setup-odes-in-python

odeint Your equation is def equation X t x y X return x y np.exp t x y 2 np.exp t and then you can solve them with init 1.0 1.0.. is def equation X t x y X return x y np.exp t x y 2 np.exp t and then you can solve them with init 1.0 1.0 t np.linpsace..

Curve fitting in Scipy with 3d data and parameters

http://stackoverflow.com/questions/17934198/curve-fitting-in-scipy-with-3d-data-and-parameters

H.T x y def gauss x s mu a import numpy as np return a np.exp x mu 2. 2. s 2. def tanhlin x p0 p1 q0 q1 q2 import numpy as..

Solve equation with a set of points

http://stackoverflow.com/questions/18619131/solve-equation-with-a-set-of-points

import import xlrd def myFunc t V W k y V t V W 1 np.exp k t k return y classeur xlrd.open_workbook path names_sheets.. import def myFunc t Vs Vi k y Vs t Vs Vi 1 np.exp k t k return y raw_x some_input raw_y some_input # scaling data.. curve_fit from pylab import def myFunc t V W k y V t V W 1 np.exp k t k return y # this generates some fake data to fit. For youm..

How to solve this differential equation using scipy odeint?

http://stackoverflow.com/questions/20019427/how-to-solve-this-differential-equation-using-scipy-odeint

10000 def Ip t return np.sqrt 2 Imag np.sin w t phi theta np.exp t tau np.sin phi theta B lambda Ip Ip 53.05 0.55 abs Ip def..

How to make scipy.interpolate give an extrapolated result beyond the input range?

http://stackoverflow.com/questions/2745329/how-to-make-scipy-interpolate-give-an-extrapolated-result-beyond-the-input-range

as np from scipy import interpolate x np.arange 0 10 y np.exp x 3.0 f interpolate.interp1d x y print f 9 print f 11 # Causes..

fitting exponential decay with no initial guessing

http://stackoverflow.com/questions/3938042/fitting-exponential-decay-with-no-initial-guessing

guess guess_a guess_b guess_c exp_decay lambda x A t y0 A np.exp x t y0 params cov curve_fit exp_decay x y p0 guess A t y0 params.. print A s nt s ny0 s n A t y0 pl.clf best_fit lambda x A np.exp t x y0 pl.plot x y 'b.' pl.plot smoothx best_fit smoothx 'r.. 'Linear Fit' plt.show def model_func t A K C return A np.exp K t C def fit_exp_linear t y C 0 y y C y np.log y K A_log np.polyfit..

python matplotlib colorbar setting tick formator/locator changes tick labels

http://stackoverflow.com/questions/6485000/python-matplotlib-colorbar-setting-tick-formator-locator-changes-tick-labels

seed 0 npts 200 x uniform 2 2 npts y uniform 2 2 npts z x np.exp x 2 y 2 # define grid xi np.linspace 2.1 2.1 100 yi np.linspace.. seed 0 npts 200 x uniform 2 2 npts y uniform 2 2 npts z x np.exp x 2 y 2 # define grid xi np.linspace 2.1 2.1 100 yi np.linspace..

numpy arbitrary precision linear algebra

http://stackoverflow.com/questions/6876377/numpy-arbitrary-precision-linear-algebra

# Missing part a np.array 800.21 600.00 600.00 1000.48 ex np.exp a ## Currently warns about underflow eigvals eigvecs np.linalg.eig..

SciPy LeastSq Goodness of Fit Estimator

http://stackoverflow.com/questions/7588371/scipy-leastsq-goodness-of-fit-estimator

255 235 208 166 157 def sigmoid p x x0 y0 c k p y c 1 np.exp k x x0 y0 return y def residuals p x y return y sigmoid p x..

scipy, lognormal distribution - parameters

http://stackoverflow.com/questions/8747761/scipy-lognormal-distribution-parameters

3 size 1000 # logsample ~ N mu 10 sigma 3 In 59 sample np.exp logsample # sample ~ lognormal 10 3 In 60 shape loc scale stats.lognorm.fit..