How to group a Series by values in pandas? January 24, 2023 by Tarik grouped = s.groupby(s) Or: grouped = s.groupby(lambda x: s[x])