skfolio.datasets.load_sp500_index#

skfolio.datasets.load_sp500_index()[source]#

Load the prices of the S&P 500 Index.

This dataset is composed of the daily prices of the S&P 500 Index starting from 1990-01-02 up to 2022-12-28.

The data comes from the Yahoo public API. The price is the adjusted close which is the closing price after adjustments for all applicable splits and dividend distributions. The adjustment uses appropriate split and dividend multipliers, adhering to the Center for Research in Security Prices (CRSP) standards.

Observations

8313

Assets

1

Returns:
dfDataFrame of shape (n_observations, n_assets)

Prices DataFrame

Examples

>>> from skfolio.datasets import load_sp500_index
>>> prices = load_sp500_index()
>>> prices.head()
             SP500
Date
1990-01-02  359.69
1990-01-03  358.76
1990-01-04  355.67
1990-01-05  352.20
1990-01-08  353.79