reformat date to YYYY/MM/DD and replace column data in CSV
<p>I'm a newbie python programmer and I have a CSV that is simple, looks like this:</p>

<pre><code>FROM_ID,JOIN_DATE,FAV_SPORT
100004,06/08/2016,Football
100006,06/08/2016,Tennis
100007,06/08/2016,Football
100009,06/08/2016,Basketball
</code></pre>

<p>I am trying to rewrite the date to YYYY/MM/DD. So far I have gotten this far:</p>

<pre><code>import csv
f = open('reg.csv')
csv_f = csv.reader(f)

for row in csv_f:
    parts = row[1].split('/')
print parts[2]
</code></pre>

<p>All this does is print out the year (YYYY), which is one step closer :) Can anyone advise how to reformat the parts into the YYYY/MM/DD format?</p>

<p>Also, I notice python doesnt have case/select. How would I create a find/replace on "FROM_ID" and replace them with another number? Like:</p>

<p><em>if FROM_ID is equal to X then Y</em></p>

<p>Thanks in advance for any help. I have scoured the internet for hours and I am a touch stuck but hoping I can get moving along. Thanks!</p>