I can query an explicit value:
fills.query('Symbol=="BUD US"')
Now I want to query a variable:
In [40]: my_symbol
Out[40]: 'BUD US'
In pandas 0.13.1, I could simply use:
fills.query('Symbol==my_symbol')
This is no longer permitted in pandas 0.14.0 because local variables must be referred to explicitly. So I tried
fills.query('Symbol==@my_symbol')
but this returned an error
KeyError: '__pd_eval_local_my_symbol'
I was able to change some of my other code to use explicit local variables, but this one just will not take. Any thoughts? The dtype is object
, if that helps.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…