Spaces:
Running
Running
James McCool
commited on
Commit
·
ee7eab7
1
Parent(s):
2bc1ea4
Working with dicts instead of backfilling
Browse files
app.py
CHANGED
@@ -226,19 +226,19 @@ with tab4:
|
|
226 |
market_type = st.selectbox('Select type of prop are you wanting to view', options = prop_table_options, key = 'market_type_key')
|
227 |
disp_market = market_props.copy()
|
228 |
disp_market = disp_market[disp_market['PropType'] == market_type]
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
|
243 |
st.dataframe(disp_market.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(prop_format, precision=2), height = 1000, use_container_width = True)
|
244 |
st.download_button(
|
|
|
226 |
market_type = st.selectbox('Select type of prop are you wanting to view', options = prop_table_options, key = 'market_type_key')
|
227 |
disp_market = market_props.copy()
|
228 |
disp_market = disp_market[disp_market['PropType'] == market_type]
|
229 |
+
fanduel_frame = disp_market[disp_market['OddsType'] == 'FANDUEL']
|
230 |
+
fanduel_dict = dict(zip(fanduel_frame['Name'], fanduel_frame['Projection']))
|
231 |
+
draftkings_frame = disp_market[disp_market['OddsType'] == 'DRAFTKINGS']
|
232 |
+
draftkings_dict = dict(zip(draftkings_frame['Name'], draftkings_frame['Projection']))
|
233 |
+
mgm_frame = disp_market[disp_market['OddsType'] == 'MGM']
|
234 |
+
mgm_dict = dict(zip(mgm_frame['Name'], mgm_frame['Projection']))
|
235 |
+
consensus_frame = disp_market[disp_market['OddsType'] == 'CONSENSUS']
|
236 |
+
consensus_dict = dict(zip(consensus_frame['Name'], consensus_frame['Projection']))
|
237 |
+
|
238 |
+
disp_market['FANDUEL_Proj'] = disp_market['Name'].map(fanduel_dict)
|
239 |
+
disp_market['DRAFTKINGS_Proj'] = disp_market['Name'].map(draftkings_dict)
|
240 |
+
disp_market['MGM_Proj'] = disp_market['Name'].map(mgm_dict)
|
241 |
+
disp_market['CONSENSUS_Proj'] = disp_market['Name'].map(consensus_dict)
|
242 |
|
243 |
st.dataframe(disp_market.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(prop_format, precision=2), height = 1000, use_container_width = True)
|
244 |
st.download_button(
|