-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
New linear algebra algorithm #1122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!! Since we are building up a library of algotithms, it would be really cool of you could create a function like def points_to_polynomial(points): that takes in some points and returns a polynomial. That will make it easier for others to move you algorithm into their own programs and will allow us to write tests for that function. Leave all the input() and print() statements outside of that function.
Current behavior... python3 linear_algebra/src/python-polynom-for-points.py The program cannot work out a fitting polynomial.
The program cannot work out a fitting polynomial.
Traceback (most recent call last):
File "linear_algebra/src/python-polynom-for-points.py", line 107, in <module>
print(points_to_polynomial([[1, 5], [2, 2], [3, 9]]))
File "linear_algebra/src/python-polynom-for-points.py", line 35, in points_to_polynomial
if check==1:
UnboundLocalError: local variable 'check' referenced before assignment |
* Added new algorithm which takes points as an input and outputs a polynom connecting them * Rename Python-Polynom-for-points.py to python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Update python-polynom-for-points.py * Add doctests and run thru psf/black
Hey,
I added a new linear algebra algorithm which takes a number of x and y coordinates as input and then outputs a polynomial function that connects them.
Thank you for taking a look at it.