Group By And Count In Python String