statsmodels.datasets.webuse

statsmodels.datasets.webuse(data, baseurl='http://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) – If True, returns a pandas.DataFrame
Returns:

dta – A record array containing the Stata dataset.

Return type:

Record Array

Examples

>>> dta = webuse('auto')

Notes

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