You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trying to unpack this. pd.Series.index returns integers when I pass a log return series to this function and thus (end_date - start_date) evaluates to a single element tuple
def get_years_past(series: pd.Series) -> float:
"""
Calculate the years past according to the index of the series for use with
functions that require annualization
"""
start_date = series.index[0]
end_date = series.index[-1]
return (end_date - start_date).days / 365.25
```
The text was updated successfully, but these errors were encountered:
Hey there, sorry for the late reply. The output of this function is intended to be a precise and easy-to-access annualization factor for metrics like the Sharpe ratio that require it.
trying to unpack this. pd.Series.index returns integers when I pass a log return series to this function and thus (end_date - start_date) evaluates to a single element tuple
The text was updated successfully, but these errors were encountered: