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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • newandlearning1
    New Member
    • Jul 2016
    • 1

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

    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,No ne)
    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
Working...