I have a dataframe df_workingFile:
group | value
a | 1
a | 3
b | 2
b | 2
I want to add two new columns - one for the min and max for each group
group | value | max | min
a | 1 | 3 | 1
a | 3 | 3 | 1
b | 2 | 2 | 2
b | 2 | 2 | 2
Right now I'm looping through each row and taking the min/max of the group's subset of data, but that's really slow with large datasets. What's an efficient way of doing this?