I'm running the following example and i accept it works perfectly, output as expected.
import numpy as np
from empyrical import roll_max_drawdown
returns = np.array([.01, .02, .03, -.4, -.06, -.02])
# calculate the rolling max drawdown
roll_max_drawdown(returns, window=3)
I was wondering is there a way to force the result/output to be the same shape/length as the original array?
e.g output would be 6 rather than 4 with the first to values = nan?
Reason: I'm trying to transform this function across a dataframe and it comee back with "Length of passed values is 4, index implies 6"
I'm running the following example and i accept it works perfectly, output as expected.
I was wondering is there a way to force the result/output to be the same shape/length as the original array?
e.g output would be 6 rather than 4 with the first to values = nan?
Reason: I'm trying to transform this function across a dataframe and it comee back with "Length of passed values is 4, index implies 6"
My hack workaround is to modify unary_vectorized_roll to end with the following
Is there a better way?