You have to specify the format (fmt
) of you data in savetxt
, in this case as a string (%s
):
num.savetxt('test.txt', DAT, delimiter=" ", fmt="%s")
The default format is a float, that is the reason it was expecting a float instead of a string and explains the error message.