Running
alphalens.tears.create_returns_tear_sheet(factor_data)
throws the error
ValueError: Inferred frequency None from passed values does not conform to passed frequency B
When I go into the source code, I see that this comes out of
alphalens.performance.factor_weights(factor_data, True, False, False)
which throws
ValueError: Inferred frequency None from passed values does not conform to passed frequency D
So I believe the problem is in factor_weights. And so, I copy the code from factor_weights over and run it in my local computer, doing
factor_weights(factor_data, True, False, False)
but it runs just fine.
I have this 'Inferred frequency' problem quite often. Would love to hear how to fix this. So far, I have tried resetting the frequency of my index:
factor_data = factor_data.unstack().asfreq(None).stack()
# or also
factor_data = factor_data.unstack().asfreq('B').stack()
# or even
factor_data = factor_data.unstack().asfreq('D').stack()
but no dice.