If you use this code, you can get all rows with bar in A
import pandas as pd
df = pd.DataFrame({'A': 'foo bar foo bar foo bar foo foo'.split(),
'B': 'one one two three two two one three'.split()})
print(df)
print("=============")
print( df.query('A== "bar"') )
WSo when I use this code, I expect to get all rows with bar in A thing but I get an error.
import pandas as pd
df = pd.DataFrame({'A thing': 'foo bar foo bar foo bar foo foo'.split(),
'B thing': 'one one two three two two one three'.split()})
print(df)
print("=============")
print( df.query('A thing== "bar"') )
is there a way of dealing with spaces in column names?