python - Python - Pd.dataframe - sum(step, []) - “只能将列表(不是“str”)连接到列表”
问题描述
我的任务是在另一台机器上运行一个脚本。我搭建了一个conda环境:Python3.6 Pandas1.0.3
系统:Ubuntu 16.04.6 Xenial
到目前为止,我只需要在脚本中将 Python2 调整为 Python3 代码,但现在我遇到了以下问题:
losses = pd.DataFrame([sum(step, []) for step in losses], colums=['Frechet Distance GAN1', 'Frechet Distance GAN2', ....])
我收到以下错误:
TypeError:只能将列表(不是“str”)连接到列表
我很确定反派是(sum(step, [])
或某种 Python2 到 Python3 的问题。
解决方案
推荐阅读
- python - os.access(os.getcwd(), os.W_OK|os.X_OK) 但权限被拒绝
- angular - 表单标记错误:没有值 > 带有名称的表单控件的访问器
- javascript - 我怎样才能读取json文件?
- algorithm - 具有作业排除和优先约束的多处理器调度
- javascript - 如何启用横向折叠
- html - 如何从 Angular 中的 img 标签触发输入图像?
- excel - 将组合框值链接到不同的工作表
- .htaccess - htaccess 正则表达式不允许“点”
- ios - iOS Apple Review Team 无法使用我提供的凭据连接到我的应用程序
- javascript - Javascript 说“功能未定义”,但它是在我的简单网页上定义的