前言 最近在工作中需要拟合高斯曲线,在python中可以使用 scipy,相关代码如下: #!/usr/bin/env python # -*- coding=utf-8 -*- %matplotlib inline import numpy as np import pylab as plt from scipy.optimize import curve_fit x = range(10) y = [25,68,144,220,335,199,52,14,5,2] def gaussian2