为什么在使用df.query命令时出现此错误?

时间:2020-05-31 07:04:23

标签: python pandas

data = df.query('Unicorn Status == "MINICORN"')

输出:我得到的是

  File "<unknown>", line 1
Unicorn Status =="MINICORN"
             ^
SyntaxError: invalid syntax

更新的问题:

df.query['`Unicorn Status`==MINICORN']

输出:

TypeError Traceback (most recent call last) <ipython-input-47-5271c922fa30> in <module>() ----> 1 df.query['独角兽状态`== MINICORN']

TypeError:“方法”对象不可下标`

0 个答案:

没有答案