I have a vector, it is np.array([[1,2,3]]).
I want to save the vector and the name of the vector in the same row.
For example
Vector1 1 2 3
Vector2 4 5 6
Vector3 7 8 9
Then, I have ever tried like this
import csv
import numpy as np
a=np.array([[1,2,3]])
b='Vector1'
c=[b,a]
with open ('testfile.csv','ab') as fxx:
w=csv.writer(fxx)
for row in c:
w.writerow(row)
then I also have tried this
import csv
import numpy as np
a=np.array([[1,2,3]])
b='Vector1'
c=np.append(b,a)
with open ('testfile3.csv','ab') as fxx:
w=csv.writer(fxx)
for row in c:
w.writerow(row)


