Pandas vectorized way to tag first occurring value(m elements) in a series of m*n elements
I have a pandas series of m*n elements of the following form where m=5 and n=3 :A: [1 1 1 1 1 0 1 1 0 0 0 0 0 1 1]I need a result series as follows :B: [1 0 0 0 0 0 1 0 0 0 0 0 0 1 0]m and n can be