I saw this question asked a few times and used the solutions I found, (such as Writing a Python list of lists to a csv file). However, for some reason, it did not work for me.
Here is my code:
import numpy as np
import csv
data = np.array([[1,2,3],[4,5,6]])
with open("~test.csv", "wb") as f:
writer = csv.writer(f,delimiter=',')
writer.writerows(data)
f.close()
I know that a numpy array can and should be treated (in this case) as a list of lists.
When I open the csv, cell A1 contains "1,2,3" and A2 contains "4,5,6". I would like the comma to correclty be used as the delimiter so that all 6 values are distributed over the range [A1:C2].
Could this be a problem with my Excel settings?