Is it possible to use a dict to group on elements of a column?
For example:
In [3]: df = pd.DataFrame({\'A\' : [\'one\', \'one\', \'two\', \'three\'
You can group with a dictionary, but (as with any group by operation) you need to set the index column first.
grouped = df.set_index("A").groupby(d)
list(grouped)
# [('End', B
# A
# three -1.550727
# three 1.048730
#
# [2 rows x 1 columns]), ('Start', B
# A
# one -1.552152
# one -2.018647
# two -0.968068
# two 0.449016
# two -0.374453
# one 0.116770
#
# [6 rows x 1 columns])]