我开始知道numpy和scipy都有polyfit功能并访问过这里:http://docs.scipy.org/doc/numpy/reference/generated/numpy.polyfit.html
为什么scipy.org有关于numpy.polyfit的页面? numpy.polyfit和scipy.polyfit是一样的吗?如果没有,我应该使用哪一个?
答案 0 :(得分:3)
polyfit
。 scipy.__init__
中的There is a line
from numpy import *
这就是将名称拉入scipy命名空间的方式。
它没有任何区别,因为它们在内存中确实是同一个对象:
>>> import scipy
>>> import numpy
>>> scipy.polyfit is numpy.polyfit
True
您也可以删除中间人并使用numpy
中的那个。