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:
  • data (str) – Name of dataset to fetch.
  • baseurl (str) – The base URL to the stata datasets.
  • as_df (bool) – Deprecated. Always returns a DataFrame
Returns:

dta – A DataFrame containing the Stata dataset.

Return type:

DataFrame

Examples

>>> dta = webuse('auto')

Notes

Make sure baseurl has trailing forward slash. Doesn’t do any error checking in response URLs.