statsmodels.datasets.get_data_home#

statsmodels.datasets.get_data_home(data_home=None)[source]#

Return the path of the statsmodels data dir.

This folder is used by some large dataset loaders to avoid downloading the data several times.

By default the data dir is set to a folder named ‘statsmodels_data’ in the user home folder.

Alternatively, it can be set by the ‘STATSMODELS_DATA’ environment variable or programmatically by giving an explicit folder path. The ‘~’ symbol is expanded to the user home folder.

If the folder does not already exist, it is automatically created.

Parameters:
data_homestr, optional

The path to the statsmodels data dir. If not given, the value of the ‘STATSMODELS_DATA’ environment variable, or a default location in the user home folder, is used.

Returns:
str

The path of the statsmodels data dir.