quantopian / empyrical

Common financial risk and performance metrics. Used by zipline and pyfolio.
https://quantopian.github.io/empyrical
Apache License 2.0
1.27k stars 398 forks source link

Fix for pandas 1.0 #124

Closed atkinson closed 4 years ago

atkinson commented 4 years ago

FIXED for Pandas >= 1.0.0

twiecki commented 4 years ago

Thanks for taking this on! Unfortunately due to being tied to zipline we need to maintain compat with their pandas requirements which are older (currently pandas>=0.18.1,<=0.22). Can you keep those tests in? Or at least 0.22?

atkinson commented 4 years ago

Hey - we could bridge the gap with a try: except: block - try to_numpy() first, then to_matrix() if that fails.

Shall I do that? Then the older tests should pass as well.

atkinson commented 4 years ago

here it is - I left a comment in the code to explain too.

twiecki commented 4 years ago

Thanks!

atkinson commented 4 years ago

My pleasure. Any chance we could push a release so I can use as a dependency?

twiecki commented 4 years ago

@richafrank I tagged a new release but couldn't upload to pypi due to permissions. Could you do that?