markowitz.data.french¶
markowitz.data.french
¶
Loader for Ken French factor datasets.
The Ken French data library distributes ZIP files containing CSV factor
returns quoted in percent. We download via :mod:urllib, parse the
CSV (skipping any header text and copyright footers), and divide by
100 so the returned frame is in decimal returns.
load_french_factors(dataset: str, *, frequency: str = 'monthly', cache_root: str | os.PathLike[str] | None = None) -> pd.DataFrame
¶
Download (or read from cache) a Ken French factor table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
str
|
Dataset identifier, e.g. |
required |
frequency
|
str
|
|
'monthly'
|
cache_root
|
str | PathLike[str] | None
|
Optional directory used to cache the raw ZIP payload. |
None
|