Pandas query function not working with spaces in column names

From pandas 0.25 onward you will be able to escape column names with backticks so you can do

a.query('`a b` == 5') 

Leave a Comment