By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,441 Members | 979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,441 IT Pros & Developers. It's quick & easy.

How would you put back a list that you've split and transformed back to the original

P: 1
I am trying to isolate date from date/time which is a column in the original csv file. I've isolated the column and change it to just date but I am having a tough time putting it back to the original file:

def isolateDate(csv_file):
file_in = open(csv_file, "rU")
reader = csv.reader(file_in)
next(file_in,None)
for line in reader:
date = line[3]
date = date.split()
new_date = date[0]
return new_date

How would I go about putting back new_date variable as the line[3] in the original file
Jul 4 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.