If you don't have anything confining you to np.savetext, then try using pickle:
import numpy as np
import pickle as pkl
path = r"path/to/dump.pkl"
a = np.array([1,2,3,4,5,6,7])
b = pkl.dump(a, path)
c = pkl.load(path)
np.testing.assertequal(c, a)
Or in console if you feel more like it,
>>> import numpy as np
>>> a = [1, 2, 3, 4, 5, 6, 7]
>>> a
[1, 2, 3, 4, 5, 6, 7]
>>> b = np.array(a)
>>> b
array([1, 2, 3, 4, 5, 6, 7])
>>> import pickle
>>> pickle.dumps(b)
b'\x80\x03cnumpy.core.multiarray\n_reconstruct\nq\x00cnumpy\nndarray\nq\x01K\x00\x85q\x02C\x01bq\x03\x87q\x04Rq\x05(K\x01K\x07\x85q\x06cnumpy\ndtype\nq\x07X\x02\x00\x00\x00i4q\x08K\x00K\x01\x87q\tRq\n(K\x03X\x01\x00\x00\x00<q\x0bNNNJ\xff\xff\xff\xffJ\xff\xff\xff\xffK\x00tq\x0cb\x89C\x1c\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x07\x00\x00\x00q\rtq\x0eb.'
>>> p = pickle.dumps(b)
>>> d = pickle.loads(p)
>>> d
array([1, 2, 3, 4, 5, 6, 7])
This won't be a human readable file, but it answers your requirement.
or, just
with open(path, 'wb') as f:
np.savetxt(f, a, fmt='%i', delimiter=",")
Which I personally favor less than the standard pickle
fmt='%.18e'. Thesavetxtdocs discusses altenativefmtvalues.fmtofsavetxt, then you can also specify thedtypeduringloadtxtwhen you read back in.floatis the default dtype forloadtxtas well.np.emptyarray. This is about writing values to acsv.