You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>>df1=pd.DataFrame({'import': ['beans', 'corn']})
>>>df1.query('import == "beans"')
...
SyntaxError: Pythonkeywordnotvalididentifierinnumexprquery>>># working alternative for reference>>>df1[df1['import'] =='beans']
import0beans
The text was updated successfully, but these errors were encountered:
for
andimport
are keywords, butlist
is not.I just tried it and it's fine:
While
import
does fail:The text was updated successfully, but these errors were encountered: