I have Input DataFrame given below. For every first unique element row ofID it has to be written zero in the Output DataFrame Zeros_For_UniqueID column. After then the consecutive zeros should be counted from theCount variable before the integer appear for the unique IDand have to be put in output column Zeros_For_UniqueID.
Input DataFrame:
ID Count
1234 1
1234 2
1234 0
1234 0
1234 0
1234 1
1234 1
5678 1
5678 5
5678 4
5678 0
1111 0
1111 0
1111 1
1111 2
1111 0
1111 0
1111 2
Output DataFrame
ID Count Zeros_For_UniqueID
1234 1 0
1234 2 0
1234 0 0
1234 0 1
1234 0 2
1234 1 3
1234 1 0
5678 1 0
5678 5 0
5678 4 0
5678 0 0
1111 0 0
1111 0 1
1111 1 2
1111 2 0
1111 0 0
1111 0 1
1111 2 2
Can anyone help me in solving this. I am new to the python and trying to solve this for my further research.Thanks!