Pandas Query /u/Alongsnake Python Education

I am trying to query an excel file, and I can’t seem to get query working. I’ve seen examples and don’t see anything different. Pandas is version 2.2.3.

My sheet looks like this. There is no indexcol. Product Name, Product Description, Product Quantity 0, Apples, Fruit, 1 1, Raspberry, Berry, 2 2, Orange, Fruit, 3

I tried df.query("'Product Description'=='Fruit'") This just gives me “KeyError: False: boolean label can not be used without a boolean index”

submitted by /u/Alongsnake
[link] [comments]

​r/learnpython I am trying to query an excel file, and I can’t seem to get query working. I’ve seen examples and don’t see anything different. Pandas is version 2.2.3. My sheet looks like this. There is no indexcol. Product Name, Product Description, Product Quantity 0, Apples, Fruit, 1 1, Raspberry, Berry, 2 2, Orange, Fruit, 3 I tried df.query(“‘Product Description’==’Fruit'”) This just gives me “KeyError: False: boolean label can not be used without a boolean index” submitted by /u/Alongsnake [link] [comments] 

I am trying to query an excel file, and I can’t seem to get query working. I’ve seen examples and don’t see anything different. Pandas is version 2.2.3.

My sheet looks like this. There is no indexcol. Product Name, Product Description, Product Quantity 0, Apples, Fruit, 1 1, Raspberry, Berry, 2 2, Orange, Fruit, 3

I tried df.query("'Product Description'=='Fruit'") This just gives me “KeyError: False: boolean label can not be used without a boolean index”

submitted by /u/Alongsnake
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *