Skip to content

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
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

@nicolaskruchten nicolaskruchten merged commit 8be4915 into master Jun 22, 2020
@nicolaskruchten nicolaskruchten deleted the trendline_fix branch July 20, 2020 14:35
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

3 participants