Numpy load TypeError: Mismatch between array dtype ('<U45') and format specifier ('%.18e')

报错信息:TypeError: Mismatch between array dtype ('<U45') and format specifier ('%.18e')

np.savetxt('wordword.txt',vocab)
np.savetxt('wordvectors.txt',embd)

参考文档
解决办法:对格式进行指定就好了

  • np.savetxt(‘foo.csv’, fmt = ‘%s’)