I'm working in Python Pandas with a dataframe that got its column names prepended with Content.
. I can access a given column by stating df['Content.xyz']
. However, when I try to perform queries on it, e.g. df.query("Content.xyz not in @mylist")
, it throws an error that Content
is not a member of the dataframe.
How can I perform a query or other similar operations with a period prepended in the name?
Also, some of the series names have spaces in them. I'm assuming the solution for a column name with a period would be similar to a solution for a name containing a space.