statsmodels.datasets.webuse

statsmodels.datasets.webuse(data, baseurl='https://www.stata-press.com/data/r11/', as_df=True)[source]

Download and return an example dataset from Stata.

Parameters:
datastr

Name of dataset to fetch.

baseurlstr

The base URL to the stata datasets.

as_dfbool

Deprecated. Always returns a DataFrame

Returns:
dtaDataFrame

A DataFrame containing the Stata dataset.

Notes

Make sure baseurl has trailing forward slash. Does not do any error checking in response URLs.

Examples

>>> dta = webuse('auto')

Last update: Nov 12, 2024