I have a dataframe which looks similar to this:
Group | Value
-----------------------
A | 1
A | 4
A | 5
B | 10
B | 7
B | 15
Basically, what I want to do is fill in the Value
column with the smallest value based on the unique value given in the Group
column, such that I get a dataframe like this:
Group | Value
-----------------------
A | 1
A | 1
A | 1
B | 7
B | 7
B | 7
i.e. since 1
is the smallest value for Group A
, change everything to 1
and since 7
is the smallest value for Group B
, change everything in Group B
to 7
I'm not sure what to do for this, so any help would be appreciated!