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

np.log can't handle NaN value in to_log_returns() #156

Open
Jmarks199 opened this issue Sep 29, 2021 · 0 comments
Open

np.log can't handle NaN value in to_log_returns() #156

Jmarks199 opened this issue Sep 29, 2021 · 0 comments

Comments

@Jmarks199
Copy link

I feel like I have to be missing something here.. this seems too obvious of an issue.

In to_log_returns() the statement is:

np.log(prices / prices.shift(1))

.shift produces NaN as the first element. Passing this series to np.log() raises TypeError because numpy can't handle the NaN. Am I missing something or is this an actual issue?

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

No branches or pull requests

1 participant