I want to use pandas to delete rows based on column name (contains space) and cell value. I tried various ways to achieve this (drop and query methods), but it seems that I am failing due to the space in the name. Is there a way to request data using a name that has a space in it, or do I need to clear all the spaces first?
data as csv file
Date,"price","Sale Item" 2012-06-11,1600.20,item1 2012-06-12,1610.02,item2 2012-06-13,1618.07,item3 2012-06-14,1624.40,item4 2012-06-15,1626.15,item5 2012-06-16,1626.15,item6 2012-06-17,1626.15,item7
Examples of Attempts
df.drop(['Sale Item'] != 'Item1') df.drop('Sale Item' != 'Item1') df.drop("'Sale Item'] != 'Item1'") df.query('Sale Item' != 'Item1') df.query(['Sale Item'] != 'Item1') df.query("'Sale Item'] != 'Item1'")
The error received in most cases
ImportError: 'numexpr' not found. Cannot use engine='numexpr' for query/eval if 'numexpr' is not installed
iNoob source share