Skip to content
Advertisement

pandas multiple conditions based on multiple columns

I am trying to color points of a pandas dataframe depending on TWO conditions. Example:

JavaScript

I have tried so many different ways now and everything I found online was only depending on one condition.

My example code always raises the Error:

JavaScript

Here’s the code. Tried several variations without success.

JavaScript

Btw: I understand, what it says but not how to handle it.

Advertisement

Answer

Selection criteria uses Boolean indexing:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement