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
Updated the polyfit function to np.polynomial.Polynomial.fit() #120
Conversation
pvanalytics/util/_fit.py
Outdated
coefficients = np.polyfit(xs, ys, 2) | ||
return np.poly1d(coefficients) | ||
# fit a quadratic function of `xs` to the data in `ys` | ||
coefficients = list(np.polynomial.Polynomial.fit(xs, ys, 2).convert()) |
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.
I think if you use polynomial.polyfit
and flipud
this would be simpler.
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.
Tried it out and verified same results--thank you for the suggestion @cwhanse !
@cwhanse what's our policy here on merging PR's in this package, ie are there a certain amount of reviewers I need to check off on this? Or are we good to merge and close now? |
@kperrynrel was just thinking about that. If either Will or I approve and we don't indicate that the other needs to look, then it's OK to merge. If your work is held up by a PR, feel free to nag us about it. |
Awesome, thanks for the clarification @cwhanse ! |
Description
Addresses issue #119, by updating the np.polyfit() function to newer np.polynomial.Polynomial.fit() function.