Closed stnatter closed 6 years ago
Hello Steffen!
What version of pandas_datareader
are you using? It appears that there is this bug on the current version, but will only be included in a future release (v0.7.0
). The thread also describes some workarounds you can implement in the meantime.
FYI, you should be aware that we have a pull request for empyrical to deprecate all functionality relying on pandas-datareader
, so hopefully this will not be a problem going forwards.
Hihi. Am using pandas_datareader v0.6.0
. Thanks for the quick response!
I see. That's the latest version, but unfortunately it still contains the bug I described. This is not a problem with pyfolio
, but with the upstream pandas-datareader
dependency. We're fixing that up, but in the meantime I can only suggest that you try out the solution described on Stack Overflow.
i applied the suggest fix and it works. thanks for your help. When you expect to have the pandas-datareader
dependency removed? The one thing i really do not like about pyfolio is the very long list of dependencies which make it fickle.
We're hoping to merge the PR as soon as possible. And yes, dependencies are an unfortunate necessity.
@twiecki looks like we can close this issue.
I have one more question if you don't mind me asking. I get the output of the full tear sheet within the output cell where i need to scroll. Is there any way to get the full output without having to scroll in the cell?
And another problem I encountered with the bayesian tearsheet which I think is because of Pandas 0.23 which if very fickle about tz aware and naive datetime. I pass in columns from a pd.df with returns and benchmark returns. The index is a DatetimeIndex with dtype='datetime64[ns]'. I am getting: TypeError: Cannot compare tz-naive and tz-aware datetime-like objects.
TypeError Traceback (most recent call last)
works when i make the index timezone aware with ret.index = ret.index.tz_localize(pytz.utc)
I'm unsure what you mean by scroll. All tear sheets are very long, so you would have to scroll no matter what. Perhaps if you clarify your question I could help. Maybe saving the tear sheets as jpg images would help?
As to the tz problem, it's a very common problem when dealing with pandas. It's not a bug with pyfolio, it's a feature in pandas: it is there to avoid ambiguity. It forces you to be explicit about your data.
Never mind. I saved the file as jpg indeed. Thanks or your help. And thanks for this amazing software. I do have one suggestion though. You might want to consider to make pyfolio less US equity centric. Common benchmarks are Hedge Fund performance indices and 60/40 portfolios (60% equity and 40% Bonds). Of course showing a beta with SP500 is fine but the way you show the Fama-French beta will be useless for many people (or is there a r way to change that already?).
Thank you! It's good to hear that this library is useful to somebody :)
@twiecki please close this issue
Hello!
installed pyfolio like this: conda install -c conda-forge pyfolio
when trying: import pyfolio as pf i get the following traceback:
ImportError Traceback (most recent call last)