Closed eigenfoo closed 6 years ago
Yup, that's a bug.
Just kidding, I used a pd.DataFrame
instead of a pd.Series
. This is actually in the docs, I'll close this down.
It should be a scalar, not a DataFrame or Series.
No in other words, px
and rets
in my code snippet above were DataFrames, but should have been Series.
Example:
Output:
This causes downstream problems for me, e.g. here: https://github.com/quantopian/empyrical/blob/ea9a9b7bde56dd14f7fad72b3bd3c27836a709b9/empyrical/stats.py#L547 since the truth value of a pd.Series is ambiguous.