写入excel数据报错:ValueError: Cannot convert {'code': 0, 'msg': 'login success!',

Posted xiamaojjie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了写入excel数据报错:ValueError: Cannot convert {'code': 0, 'msg': 'login success!', 相关的知识,希望对你有一定的参考价值。

今天在把测试结果以json格式写回excel表格中的时候报错,ValueError: Cannot convert {‘code‘: 0, ‘msg‘: ‘login success!‘, ‘username‘: ‘test‘,} to Excel,无法转换到excel

产生原因:excel只支持字符串格式存入,不支持json格式的数据。

解决:str强制转换成字符串存入:

技术图片

以上是关于写入excel数据报错:ValueError: Cannot convert {'code': 0, 'msg': 'login success!', 的主要内容,如果未能解决你的问题,请参考以下文章

利用VBA向excel表格中写入数据后,再次运行程序的话写入速度会非常慢

什么函数能够将结构化数据写入excel文件中

在Excel C#范围内写入二维对象数组

新手,易语言将数据写入excel指定单元格

访问 pandas.read_excel() 转换器中 ValueError 的详细信息

java读取excel报错