I run a DO in Stata cleaning my dataset and then call Python to run a script to generate some needed variables (3 columns) using:
outsheet unique_id group_1 group_2 group 3 group_4 group_5 group_6 group_7 using groups.csv, comma replace
shell python.exe group_fix.py
This creates a spreadsheet called group_fix.csv that has 4 columns unique_id, group_fix_1, group_fix_2, and group_fix 3. I would like to use the unique_id field (which is in my dataset and the Py output) to merge these datasets. So basically in Stata it will look like before I called Py plus the 3 new columns my script created so I can then continue on my DO and do the needed analysis.
Any ideas?