title: How to save csv file to specific folder?
body: <p>I want to read each head of each column (A=77.34, B=78.28, C=85.44 and D=92.46 in this case) and to save the DataFrame. If all these heads are greater than 65, save as csv file to specific folder (High). If low than 55, save as csv to specific folder (Low).
  I can't see any csv file in the folder (High in this case), and i don't understand where is my problem. I am using Python27. </p>
  
  <p>My program:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import os
  import csv
  
  df = pd.DataFrame({'A': [77.34, 44.09, 44.15, 43.61],
                     'B': [78.28, 46.28, 46.00, 46.03],
                     'C': [85.44, 41.89, 42.15, 42.65],
                     'D': [92.46, 42.22, 42.55, 42.02]
                    }, index=pd.Index(range(4), name='idx'))
  
  X1=df.iloc[0,0]
  X2=df.iloc[0,1]
  X3=df.iloc[0,2]
  X4=df.iloc[0,3]
  
  def Rho (df): 
      if  (X1&gt;65 and X2&gt;65 and X3&gt;65 and X4&gt;65):
          df.to_csv('High.csv')
          path = 'D:\My_Path\High'
          extension = 'csv'
          os.chdir(path)
      elif (X1&lt;55 and X2&lt;55 and X3&lt;55 and X4&lt;55):
          df.to_csv('Low.csv')
          path = 'D:\My_Path\Low'
          extension = 'csv'
          os.chdir(path)        
      else:
          print("Ignore")       
  Rho (df) 
  </code></pre>