Closed fccoelho closed 6 years ago
Right, I get the same error. It seems only the validation check for "fama_french" plot fails. I have individually tried the other plots, they are ok with the dame data.
I seems to be getting the same on "fama_french" plot, any pointers to resolve this will be much appreciated. Thanks
We should fail gracefully if the fama_french
plot doesn't work. A try/except might already be good enough.
PRs welcome!
i have same error
Found input variables with inconsistent numbers of samples: [127, 183]
I'm facing the same error. Has anybody found the solution?
+1
I even put Returns df and Benchmark_rets df to a same index, removed NaN, checked their shapes (are the same) but I always end up in this error. Is there any solution?
Ok, I found a workaround - actually a feature of Python which is unheard of in C-family languages.
You can change an external module function to an arbitrary code. Insane, really!
So the error in create_full_tear_sheet
(and create_returns_tear_sheet
) is the plotting.plot_rolling_fama_french
function in plotting.py.
So you can simply change the plotting.plot_rolling_fama_french
function to something else.
For instance:
pyfolio.plotting.plot_rolling_fama_french = pyfolio.plotting.plot_returns
Put this line just above create_full_tear_sheet
function.
This way you will disable the faulty fama_french.
@nemozny Or you could update to master where this function has been removed (pip install -U git+https://github.com/quantopian/pyfolio
).
in pyfolio's rolling_fama_french function(line 550) in timeseries.py change to this so that A, B has same dimensions:
A = factor_returns[beg:end]
B = returns[beg:end]
idx = A.index.intersection(B.index)
A = A.loc[idx]
B = B.loc[idx]
I am trying to run the various
create_*_tear_sheet
, but it always failes with this error.It seems to work with the return series dowloaded by Pyfolio as shown in the tutorial.
here is my code:
and here is the error:
here is a description of my series: