I have a dataframe like:
ID value
111 1
111 0
111 1
111 0
111 0
111 0
111 1
222 1
222 0
222 0
222 1
For each ID, I need the maximum number of times 0 appears in a row.
In this case, since 0 appears thrice in a row for ID 111 and twice in a row for 222, the desired output should be:
ID count_max_0
111 3
222 2
value_counts does not do what I want since it counts all values in the column.
How can I do that?

sum()0 0 0 0 0. The max number of only 0