Convert a dta file to csv without Stata software

Brian picture Brian · Mar 29, 2010 · Viewed 133.6k times · Source

Is there a way to convert a dta file to a csv?

I do not have a version of Stata installed on my computer, so I cannot do something like:

File --> "Save as csv"

Answer

LondonRob picture LondonRob · Sep 15, 2014

The frankly-incredible data-analysis library for Python called Pandas has a function to read Stata files.

After installing Pandas you can just do:

>>> import pandas as pd
>>> data = pd.io.stata.read_stata('my_stata_file.dta')
>>> data.to_csv('my_stata_file.csv')

Amazing!