title: Calling Python from Stata
body: <p>This is probably very easy, but after looking through documentation and possible examples online for the past several hours I cannot figure it out.</p>
  
  <p>I have a large dataset (a spreadsheet) that gets heavily cleaned by a DO file. In the DO file I then want to save certain variables of the cleaned data as a temp .csv run some Python scripts, that produce a new CSV and then append that output to my cleaned data.</p>
  
  <p>If that was unclear here is an example.</p>
  
  <p><code>After cleaning my data set (XYZ) goes from variables A to Z with 100 observations. I want to take variables A and D through F and save it as test.csv. I then want to run a python script that takes this data and creates new variables AA to GG. I want to then take that information and append it to the XYZ dataset (making the dataset now go from A to GG with 100 observations) and then be able to run a second part of my DO file for analysis.</code></p>
  
  <p>I have been doing this manually and it is fine but the file is going to start changing quickly and it would save me a lot of time.</p>