skfolio.datasets.load_nasdaq_dataset#

skfolio.datasets.load_nasdaq_dataset(data_home=None, download_if_missing=True)[source]#

Load the prices of 1455 assets from the NASDAQ Composite Index.

This dataset contains daily adjusted closing prices of 1455 assets from the NASDAQ Composite, covering the period from 2018-01-02 up to 2023-05-31.

Caution

This dataset is provided solely for testing and example purposes. It is a stale dataset and does not reflect current or accurate market prices. It is not intended for investment, trading, or commercial use and should not be relied upon as authoritative market data.

Observations

1362

Assets

1455

Parameters:
data_homestr, optional

Specify another download and cache folder for the datasets. By default, all skfolio data is stored in ~/skfolio_data subfolders.

download_if_missingbool, default=True

If False, raise an OSError if the data is not locally available instead of trying to download the data from the source site.

Returns:
dfDataFrame of shape (n_observations, n_assets)

Prices DataFrame

Examples

>>> from skfolio.datasets import load_nasdaq_dataset
>>> prices = load_nasdaq_dataset()
>>> prices.head()
               AAL   AAOI    AAON    AAPL  ...  ZVRA   ZYME    ZYNE   ZYXI
Date                                       ...
2018-01-02  51.648  37.91  35.621  41.310  ...  66.4  7.933  12.995  2.922
2018-01-03  51.014  37.89  36.247  41.303  ...  72.8  7.965  13.460  2.913
2018-01-04  51.336  38.38  36.103  41.495  ...  78.4  8.430  12.700  2.869
2018-01-05  51.316  38.89  36.681  41.967  ...  77.6  8.400  12.495  2.780
2018-01-08  50.809  38.37  36.103  41.811  ...  82.4  8.310  12.550  2.825