ffn icon indicating copy to clipboard operation
ffn copied to clipboard

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

Open Jmarks199 opened this issue 3 years ago • 0 comments

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?

Jmarks199 avatar Sep 29 '21 13:09 Jmarks199