export data and labels in cvs file
Hi experts!
I have the Numpy arrays AAA=[a1,a2,...]
and BBB=[b1,b2,...]
. I know that I can export these arrays doing:
np.savetxt('array AAA.csv', AAA, delimiter=',')
np.savetxt('array BBB.csv', BBB, delimiter=',')
I wanna export one csv file that include both arrays + labels, in this way:
AAA | BBB
----------
a1 | b1
a2 | b2
. | .
. | .
. | .
How can I do that?
Waiting for your answers.
Thanks a lot.
Best regards
Do you mean a csv file? In that case, perhaps taking a look at the `csv` module documentation might be helpful. The [third](https://docs.python.org/2/library/csv.html#examples) example there that might be useful for your purposes. It might help to send as input to the `writerows` method the `zip` of `AAA` and `BBB` from your example.
Thanks a lot fidbc!!