Reputation: 388
I have this dataframe :
d =pd.DataFrame({'Values': [4, 5, 56, 5, 6, 35]})
And I want to print True
if the last 3 values are >0
This is what I've done
d[-3:]>0
And I got
Values
3 True
4 True
5 True
But this is not exactly what I want. I want to check the last 3 value and if they are all >0 then print True otherwise print False.
Thank you for the help
Upvotes: 0
Views: 31