You can just pipe the chunk_by result like this: |> Enum.reject(&1 == [0])?
chunk_by
|> Enum.reject(&1 == [0])