I have the following dataframe:
name   state  teams      score
abc    NY      red         1
def    VA      yellow      9
ghi    MO      green       6
abc    WA      red         2
klm    IL      yellow      1
ghi    MN      green       8
def    VA      blue        3
xyz    NY      blue        5
abc    NY      blue        5
abc    NY      red         4
ghi    MN      green       7
I want to group the data in such a way for every name state combination, I want the least score for each team, for example in the data we have: name 'abc', state 'NY' and team 'red' has two scores 1 and 4 then here the least score for team 'red' is 1.
And for the teams we do not have the score the least score can be 0.
Example Output:
name  state   red  yellow  green blue
abc    NY      1    0      0      5
def    VA      0    9      0      3
ghi    MO      0    0      6      0
abc    WA      ....................
klm    IL      ....................
ghi    MN      0    0      7     0     
xyz    NY      0    0     0     5   
 
    