famafrench.utils.get_kfpriorfactors_directly

famafrench.utils.get_kfpriorfactors_directly(kflib_name, kflib_freq, kf_factor)[source]

Directly download (from Ken French’s online library) zipped monthly or annual datafiles for the Short-Term Reversal or Long-Term Reversal Fama-French-style factors. This is required since the pandas_datareader.web() method is broken for such datafiles.

Parameters
  • kflib_name (str) – Name of zipped datafile.

  • kflib_freq (str) –

    Observation frequency of factor portfolios. Possible choices are:

    • M: monthly

    • A: annual

  • kf_factor (str) –

    The name or “label” of the Fama-French-style factor. Possible choices are:

    • ST_Rev : Short-Term Reversal - based on Prior (1-1) returns

    • LT_Rev : Long-Term Reversal - based on Prior (13-60) returns

Returns

kflib_data – Dataset with time-series of the Fama-French-style factor.

Return type

pandas.DataFrame