Is there an easily available implementation of erf() for Python?

后端 未结 8 1949
日久生厌
日久生厌 2020-12-24 04:54

I can implement the error function, erf, myself, but I\'d prefer not to. Is there a python package with no external dependencies that contains an implementation of this func

8条回答
  •  囚心锁ツ
    2020-12-24 05:33

    I would recommend you download numpy (to have efficiant matrix in python) and scipy (a Matlab toolbox substitute, which uses numpy). The erf function lies in scipy.

    >>>from scipy.special import erf
    >>>help(erf)
    

    You can also use the erf function defined in pylab, but this is more intended at plotting the results of the things you compute with numpy and scipy. If you want an all-in-one installation of these software you can use directly the Python Enthought distribution.

提交回复
热议问题