ffn
ffn copied to clipboard
np.log can't handle NaN value in to_log_returns()
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?