I am trying to use writer.writerow to present data from an array to an csv file. I have an array sum_balance and apparently I need to convert it into a numpy array before I can use the writer.writerow function. Heres my code:
numpy_arr = array(sum_balance)
with open("output.csv", "wb") as csv_file:
writer = csv.writer(csv_file, delimiter=',')
for element in numpy_arr:
writer.writerow(element)
csv_file.close()
But I still get the error: writer.writerow(element)_csv.Error: iterable expected, not numpy.float64