So I have a program that reads a CSV file and performs some computations with the data before outputting it to a separate file. It was working fine yesterday, but when I came back it the program terminates without ever calling the for loop that iterates through each line of the CSV. No error is given. Does anyone know the reason for this?
Below is the function.
def my_map(my_input_stream, my_output_stream, my_mapper_input_parameters):
#files = glob.glob(my_input_stream)
#f = open(my_input_stream,"w")
out = codecs.open(my_output_stream,"w")
with open(my_input_stream) as csv_file:
csv_reader = csv.reader(csv_file)
for line in csv_reader:
stop_station = line[7]
start_station = line[3]
print(start_station)
out.write(f"{start_station}\t(1,0)\n")
print("Writing to file..")
out.write(f"{stop_station}\t(0,1)\n")
out.close()
Everything works fine apart from the for loop.