I am trying to create a text file with multiple array as the columns in this file. The trick is that each array is a different datatype. For example:
a = np.zeros(100,dtype=np.int)+2 #integers all twos
b = QC_String = np.array(['NA']*100) #strings all 'NA'
c = np.ones(100,dtype=np.float)*99.9999 #floats all 99.9999
np.savetxt('filename.txt',[a,b,c],delimiter='\t')
However, I get an error:
TypeError: Mismatch between array dtype ('|S32') and format specifier
('%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e %.18e
%.18e')
Any ideas? Thanks!