string格式寫到.csv文件出現
Mismatch between array dtype ('<U18') and format specifier ('%.18e')
報錯
原碼:np.savetxt('./filename.csv', fileNames, delimiter=',')
修改后:np.savetxt('./filename.csv', fileNames, delimiter=',',fmt = '%s')
加上fmt = ‘%s’指明類型即可
string格式寫到.csv文件出現
Mismatch between array dtype ('<U18') and format specifier ('%.18e')
報錯
原碼:np.savetxt('./filename.csv', fileNames, delimiter=',')
修改后:np.savetxt('./filename.csv', fileNames, delimiter=',',fmt = '%s')
加上fmt = ‘%s’指明類型即可
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。