I am trying to get a 1s score in the tail of a pandas frame. From this data frame:
x 1 2 3 1 1 1
I want to get a score of 3 . If there is no 1s in the tail, the function should return 0. I could not find any pandas function for this. Any ideas?
source share