Skip to content
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

make trendlines more robust #2554

Merged
merged 4 commits into from
Jun 22, 2020
Merged

make trendlines more robust #2554

merged 4 commits into from
Jun 22, 2020

Conversation

nicolaskruchten
Copy link
Contributor

@nicolaskruchten nicolaskruchten commented Jun 8, 2020

Closes #2549 (trendlines with zero slope) as well as a couple of other issues I found while testing:

@nicolaskruchten nicolaskruchten added this to the 4.8.2 milestone Jun 8, 2020
if x.dtype.type == np.datetime64:
x = x.astype(int) / 10 ** 9 # convert to unix epoch seconds
x_is_date = True
elif x.dtype.type == np.object_:
x = x.astype(np.float64)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here if we have strings like the data column of px.data.stocks() this will raise an error message ValueError: could not convert string to float: '2018-01-01'. This is not a regression since the error message is better than the current one deep in statsmodels, but this line could be in a try except statement with an error message written by us.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, will fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when using OLS trendline on single-point data
2 participants