ranaroussi / quantstats

Portfolio analytics for quants, written in Python
Apache License 2.0
4.73k stars 827 forks source link

Omega ratio function doesnt support single returns series #285

Open Kr0san opened 1 year ago

Kr0san commented 1 year ago

Pandas >= 1.5.2

omega function call appears to throw an error with the following:

numer = returns_less_thresh[returns_less_thresh > 0.0].sum().values[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'numpy.float64' object has no attribute 'values'

Looks like it expects returns parameter to be a dataframe with multiple return columns rather than single series?