使用Python库创建二次方程

2024-04-29 00:02:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我有数据点,我需要创建二次曲线等式。Do我们有任何创建二次方程的python模块。我有手动方法,在下面的链接中提到。 但我觉得它可以在更好的Python.In在下面的例子中,他们拿了3分 根据用户输入的情况而变化

http://www.algebra.com/algebra/homework/quadratic/Quadratic_Equations.faq.question.192159.html


Tags: 模块数据方法用户incomhttp链接
1条回答
网友
1楼 · 发布于 2024-04-29 00:02:11

看看http://www.numpy.org/

>>> import numpy as np
>>> A, B, C = np.polyfit([1,2,3],[4,7,12],2)
>>> print A, B, C
1.0 -4.2727620148e-15 3.0
>>> print A, 'x^2 +', B, 'x +', C
1.0 x^2 + -4.2727620148e-15 x + 3.0
>>>

相关问题 更多 >