python - how to save a column vector in an iteration process to a text file -


i need save column vector obtained in iteration text file using python.

this have been using till now

savetxt('displacement{0}.out'.format(globdat.cycle), a, delimiter=',', fmt='%10.4e',)  

globdat.cycle used count in each iteration separate file made.

requirement - not require separate files single file contains vectors corresponding each iteration.

eg - iteration 1 values = [ 1 2 3 4 5 6 ]' , iteration 2 values = [ c v b f h ]'

my text file should similar to

1,a

2,c

3,v

4,b

5,f

6,h

i appreciate help.

thanks


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -