statsmodels.iolib.foreign.genfromdta

statsmodels.iolib.foreign.genfromdta(fname, missing_flt=-999.0, encoding=None, pandas=False, convert_dates=True) [source]

Returns an ndarray or DataFrame from a Stata .dta file.

Parameters:
  • fname (str or filehandle) – Stata .dta file.
  • missing_flt (numeric) – The numeric value to replace missing values with. Will be used for any numeric value.
  • encoding (string, optional) – Used for Python 3 only. Encoding to use when reading the .dta file. Defaults to locale.getpreferredencoding
  • pandas (bool) – Optionally return a DataFrame instead of an ndarray
  • convert_dates (bool) – If convert_dates is True, then Stata formatted dates will be converted to datetime types according to the variable’s format.

© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.iolib.foreign.genfromdta.html