I am trying to efficiently add another element to this code below, that takes into account the value of another column in this df.
Below I have a filter if the value column is >= 0, but I want to add an element that says if the column called day = 'Friday', thanks.
df[df['value']] >= 0
use this
df[(df['value']>=0) & (df['day']=='friday') ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With