报错信息: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’)
正确代码:
np.savetxt('wordword.txt',vocab,fmt ='%s')
np.savetxt('wordvectors.txt',embd,fmt ='%s')
网友评论