Registry / data / datasetsforecast

datasetsforecast

JSON →
library1.0.1pypypi✓ verified 85d ago

A Python library providing popular time series forecasting datasets (M3, M4, M5, etc.) with easy loading, splitting, and preprocessing. Current version 1.0.1, released June 2025. Maintained by Nixtla, with monthly releases.

pip install datasetsforecast
INSTALL
IMPORT
SIG · DATASETSFORECAST
D
datasetsforecast
datapythonv1.0.1
Install
20.6s avg
Import
1832ms
Disk
449MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 20.6s · import 1.832s · 445MB
449MB installed
● package 449MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

M4
from datasetsforecast.m4 import M4
from datasetsforecast import M4
M4 is a class in the m4 module, not top-level.
M5
from datasetsforecast.m5 import M5
from datasetsforecast import M5
M5 is a class in the m5 module.
HierarchicalData
from datasetsforecast.hierarchical import HierarchicalData
from datasetsforecast import HierarchicalData
HierarchicalData is in the hierarchical module.

Load the M4 yearly dataset and preview the training set.

from datasetsforecast.m4 import M4 dataset = M4.load('Yearly') print(dataset['train'].head())
Debug
Known issues
breakingIn v1.0.0, the `losses` and `evaluation` modules were removed. Any imports from `datasetsforecast.losses` or `datasetsforecast.evaluation` will fail.
fix
Remove imports of `losses` and `evaluation`. Use alternative libraries like `numpy` or `scikit-learn` for metrics.
affects: >=1.0.0
gotchaDataset classes (M3, M4, M5, etc.) are not directly importable from the top-level `datasetsforecast` package. You must import from the submodule (e.g., `from datasetsforecast.m4 import M4`).
fix
Use correct submodule path as shown in the imports section.
affects: all
gotchaThe `M3` dataset download URL changed in v1.0.1. If you're on an older version, you may get a 404 error. Upgrade to >=1.0.1.
fix
Run `pip install datasetsforecast>=1.0.1`.
affects: <1.0.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'datasetsforecast.losses'
The 'losses' module was removed in v1.0.0 as a breaking change.
fix
Remove any import of `datasetsforecast.losses`. Use another metrics library or compute metrics manually.
AttributeError: module 'datasetsforecast' has no attribute 'M4'
M4 is not exported at the top level; it's in `datasetsforecast.m4`.
fix
Change the import to `from datasetsforecast.m4 import M4`.
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://zenodo.org/record/...
Outdated dataset download URL, fixed in v1.0.1 for M3 and other datasets.
fix
Upgrade to datasetsforecast>=1.0.1: `pip install --upgrade datasetsforecast`.
Upgrade
Version history
1.0.1latest on PyPI · released Feb 24, 2026
Audit
Dependencies
pandasrequiredData manipulation
numpyrequiredNumerical arrays
requestsrequiredData download
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
datasetsforecast — pip install datasetsforecast · libregistry