float()参数必须是字符串或数字,而不是“zip”

2024-03-29 12:02:46 发布

您现在位置:Python中文网/ 问答频道 /正文

在Python2.7中运行时没有问题,但在Python3中运行时出现错误。

这段代码中有什么需要更改的地方吗。

import matplotlib as mpl
poly = mpl.path.Path(zip(listx,listy))

我得到的错误是

TypeError: float() argument must be a string or a number, not 'zip'

Tags: path代码importmatplotlibas地方错误zip