Multichem commited on
Commit
4ebe0a9
·
verified ·
1 Parent(s): 1ecb8af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -18
app.py CHANGED
@@ -114,9 +114,7 @@ with col2:
114
  comb_DF['ADP_2'] = comb_DF[1].map(adp_dict)
115
  comb_DF['ADP_3'] = comb_DF[2].map(adp_dict)
116
 
117
- comb_DF['Value'] = ([comb_DF[0].map(diff_dict),
118
- comb_DF[1].map(diff_dict),
119
- comb_DF[2].map(diff_dict)]).mean()
120
 
121
  elif stack_size == 4:
122
  comb_DF['Team'] = comb_DF[0].map(team_dict)
@@ -131,10 +129,7 @@ with col2:
131
  comb_DF['ADP_3'] = comb_DF[2].map(adp_dict)
132
  comb_DF['ADP_4'] = comb_DF[3].map(adp_dict)
133
 
134
- comb_DF['Value'] = ([comb_DF[0].map(diff_dict),
135
- comb_DF[1].map(diff_dict),
136
- comb_DF[2].map(diff_dict),
137
- comb_DF[3].map(diff_dict)]).mean()
138
 
139
  elif stack_size == 5:
140
  comb_DF['Team'] = comb_DF[0].map(team_dict)
@@ -151,11 +146,7 @@ with col2:
151
  comb_DF['ADP_4'] = comb_DF[3].map(adp_dict)
152
  comb_DF['ADP_5'] = comb_DF[4].map(adp_dict)
153
 
154
- comb_DF['Value'] = ([comb_DF[0].map(diff_dict),
155
- comb_DF[1].map(diff_dict),
156
- comb_DF[2].map(diff_dict),
157
- comb_DF[3].map(diff_dict),
158
- comb_DF[4].map(diff_dict)]).mean()
159
 
160
  elif stack_size == 6:
161
  comb_DF['Team'] = comb_DF[0].map(team_dict)
@@ -174,12 +165,7 @@ with col2:
174
  comb_DF['ADP_5'] = comb_DF[4].map(adp_dict)
175
  comb_DF['ADP_6'] = comb_DF[5].map(adp_dict)
176
 
177
- comb_DF['Value'] = ([comb_DF[0].map(diff_dict),
178
- comb_DF[1].map(diff_dict),
179
- comb_DF[2].map(diff_dict),
180
- comb_DF[3].map(diff_dict),
181
- comb_DF[4].map(diff_dict),
182
- comb_DF[5].map(diff_dict)]).mean()
183
 
184
  comb_DF = comb_DF.sort_values(by='Proj', ascending=False)
185
 
 
114
  comb_DF['ADP_2'] = comb_DF[1].map(adp_dict)
115
  comb_DF['ADP_3'] = comb_DF[2].map(adp_dict)
116
 
117
+ comb_DF['Value'] = comb_DF.apply(lambda row: pd.Series([diff_dict.get(row[i], None) for i in range(3)]).mean(), axis=1)
 
 
118
 
119
  elif stack_size == 4:
120
  comb_DF['Team'] = comb_DF[0].map(team_dict)
 
129
  comb_DF['ADP_3'] = comb_DF[2].map(adp_dict)
130
  comb_DF['ADP_4'] = comb_DF[3].map(adp_dict)
131
 
132
+ comb_DF['Value'] = comb_DF.apply(lambda row: pd.Series([diff_dict.get(row[i], None) for i in range(4)]).mean(), axis=1)
 
 
 
133
 
134
  elif stack_size == 5:
135
  comb_DF['Team'] = comb_DF[0].map(team_dict)
 
146
  comb_DF['ADP_4'] = comb_DF[3].map(adp_dict)
147
  comb_DF['ADP_5'] = comb_DF[4].map(adp_dict)
148
 
149
+ comb_DF['Value'] = comb_DF.apply(lambda row: pd.Series([diff_dict.get(row[i], None) for i in range(5)]).mean(), axis=1)
 
 
 
 
150
 
151
  elif stack_size == 6:
152
  comb_DF['Team'] = comb_DF[0].map(team_dict)
 
165
  comb_DF['ADP_5'] = comb_DF[4].map(adp_dict)
166
  comb_DF['ADP_6'] = comb_DF[5].map(adp_dict)
167
 
168
+ comb_DF['Value'] = comb_DF.apply(lambda row: pd.Series([diff_dict.get(row[i], None) for i in range(6)]).mean(), axis=1)
 
 
 
 
 
169
 
170
  comb_DF = comb_DF.sort_values(by='Proj', ascending=False)
171