pandas.io.stata.StataReader.data

StataReader.data(self, **kwargs)[source]

Read observations from Stata file, converting them into a dataframe

Deprecated since version This: is a legacy method. Use read in new code.

Parameters
convert_datesboolean, defaults to True

Convert date variables to DataFrame time values.

convert_categoricalsboolean, defaults to True

Read value labels and convert columns to Categorical/Factor variables.

index_colstring, optional, default: None

Column to set as index.

convert_missingboolean, defaults to False

Flag indicating whether to convert missing values to their Stata representations. If False, missing values are replaced with nan. If True, columns containing missing values are returned with object data types and missing values are represented by StataMissingValue objects.

preserve_dtypesboolean, defaults to True

Preserve Stata datatypes. If False, numeric data are upcast to pandas default types for foreign data (float64 or int64).

columnslist or None

Columns to retain. Columns will be returned in the given order. None returns all columns.

order_categoricalsboolean, defaults to True

Flag indicating whether converted categorical data are ordered.

Returns
DataFrame
Scroll To Top