Last active
July 14, 2020 09:16
-
-
Save BexTuychiev/3562c0c9ff75279addf6c9bac667f48c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Importing a stata file | |
import pandas as pd | |
dta = pd.read_stata('cola.dta') | |
print(dta) | |
# Saving as a stata file | |
# Read any csv file or any DataFrame | |
df = pd.read_csv('sample.csv') | |
# Save as .dta file | |
df.to_stata('sample.dta') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment