quantopian / alphalens

Performance analysis of predictive (alpha) stock factors
http://quantopian.github.io/alphalens
Apache License 2.0
3.2k stars 1.12k forks source link

MAINT: code refactoring to make it compatible with pandas 0.23.4 #328

Closed luca-s closed 5 years ago

luca-s commented 5 years ago

Added freq argument to plot.plot_cumulative_returns and plot.plot_cumulative_returns_by_quantile, which allow to avoid settings the index frequency inside perf.to_weights and perf.factor_returns (which in turn causes pandas 0.23.4 to crash, see #319 )

Also this closes #319

twiecki commented 5 years ago

wasn't there a commit to add newer pandas to travis?

luca-s commented 5 years ago

wasn't there a commit to add newer pandas to travis?

Yes, but I removed it because there are changes in pandas 0.23.4 that conflict with pandas 0.18.1 and some tests fail. Those tests are not that meaningful, e.g. some nans are returned as 0s in new pandas and some indices need to be Categorical. Anyway I didn't want to chase what changed internally in pandas, so when we get rid of pandas 0.18.1 we can update the tests for new pandas versions.

twiecki commented 5 years ago

Thanks @luca-s!