小编lbu*_*bug的帖子

查询 Pandas DataFrame 时出现 UndefinedVariableError

我正在尝试通过查询 pandas 中的值来创建图形DataFrame

在这一行:

data1 = [np.array(df.query('type == i')['continuous']
         for i in ('Type1', 'Type2', 'Type3', 'Type4')]
Run Code Online (Sandbox Code Playgroud)

我收到错误:

UndefinedVariableError: name 'i' is not defined
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

python pandas

9
推荐指数
1
解决办法
7174
查看次数

标签 统计

pandas ×1

python ×1