python read in Stata data

import pandas as pd

df = pd.read_stata(DataDir)

FeatureName = pd.io.stata.StataReader(DataDir).variable_labels()

# replace column names with label names
df_labeled = df.rename(columns =FeatureName)

Leave a Reply

Your email address will not be published. Required fields are marked *