quantlab.factor.predefined.residual_momentum.read_fama_french#

quantlab.factor.predefined.residual_momentum.read_fama_french(path)[source]#

Read a Fama-French CSV into a frame of decimal returns indexed by date.

The file is the one scripts/fama_french.py writes: a date column plus mkt_rf, smb, hml and risk_free. Extra columns are ignored.

Parameters:
pathstr or Path

The CSV file.

Returns:
pd.DataFrame

The four FAMA_FRENCH_COLUMNS as floats on a sorted, unique DatetimeIndex named date.

Raises:
ValueError

If a required column is missing or a date is repeated.

Examples

>>> read_fama_french("ff3_daily.csv").tail(2)
            mkt_rf     smb     hml  risk_free
date
2026-08-28 -0.0034 -0.0051  0.0028     0.0001
2026-08-31 -0.0033 -0.0002 -0.0039     0.0001