title: Changing CSV files in python
body: <p>I have a bunch of CSV files with 4 line headers. In these files, I want to change the values in the sixth column based on the values in the second column. For example, if the second column, under the name <code>PRODUCT</code> is <code>Banana</code>, I would want to change the value in the same row under <code>TIME</code> to <code>10m</code>. If the the product was <code>Apple</code> I would want the time to be <code>15m</code> and so on.</p>
  
  <pre><code>When    12:07           
  Area    Produce             
  Store Name   FF             
  Eatfresh                    
  PN  PRODUCT NUMBER  INV ENT TIME
  1    Banana 600000                5m
  2    Apple  400000       F4        8m                                              
  3    Pair                       6m
  4    Banana 4000     G3            7m
  5    Watermelon 700000          13m
  6    Orange 12000               2m
  7    Apple  1650000         6m
  </code></pre>
  
  <p><strong>Desired Output</strong></p>
  
  <pre><code>When    12:07           
  Area    Produce             
  Store Name   FF             
  Eatfresh                    
  PN  PRODUCT NUMBER  INV ENT TIME
  1    Banana 600000                10m
  2    Apple  400000       F4        15m                                              
  3    Pair                       6m
  4    Banana 4000     G3            10m
  5    Watermelon 700000          13m
  6    Orange 12000               2m
  7    Apple  1650000         15m
  </code></pre>
  
  <p>I want to output all of them to be outputed to a directory call <code>NTime</code>. Here is what I have thus far, but being new to coding, I don't really understand a great deal and have gotten stuck on how to make the actual changes. I found <a href="https://stackoverflow.com/questions/17128302/python-pandas-idiom-for-if-then-else">Python/pandas idiom for if/then/else</a> and it seems similar to what I want to do, but I don't completely understand what is going on.</p>
  
  <pre><code>import pandas as pd
  import glob
  import os
  
  fns = glob.glob('*.csv') 
  colname1 = 'PRODUCT'
  colname2 = 'TIME'
  
  for csv in fns:
      s = pd.read_csv(csv, usecols=[colname1], squeeze=True, skiprows=4, header=0)
  
  
  
      with open(os.path.join('NTime', fn), 'wb') as f:
  </code></pre>
  
  <p>Can someone help me?</p>