Importing groupie

The following code transforms a string of zeros and ones in a form of consecutive zeros and ones. E.g., “00001110000111” will be 4,3,4,3. Without importing I had written the following code for the same task: For a minute I thought that the original code was more readable than the groupby one but I was wrong.