Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -88,10 +88,10 @@ with tab1:
|
|
88 |
team_var1 = player_frame.Team.values.tolist()
|
89 |
pos_split1 = st.radio("Are you viewing all positions, specific groups, or specific positions?", ('All Positions', 'Specific Positions'), key='pos_split1')
|
90 |
if pos_split1 == 'Specific Positions':
|
91 |
-
pos_var1 = st.multiselect('What Positions would you like to view?', options = ['
|
92 |
elif pos_split1 == 'All Positions':
|
93 |
pos_var1 = 'All'
|
94 |
-
sal_var1 = st.slider("Is there a certain price range you want to view?", 2000, 10000, (2000,
|
95 |
|
96 |
with col2:
|
97 |
final_Proj = player_frame[player_frame['Site'] == str(site_var1)]
|
@@ -100,7 +100,9 @@ with tab1:
|
|
100 |
final_Proj = final_Proj[final_Proj['Salary'] <= sal_var1[1]]
|
101 |
if pos_var1 != 'All':
|
102 |
final_Proj = final_Proj[final_Proj['Position'].str.contains('|'.join(pos_var1))]
|
103 |
-
final_Proj = final_Proj
|
|
|
|
|
104 |
final_Proj = final_Proj.set_index('Player')
|
105 |
final_Proj = final_Proj.sort_values(by='Median', ascending=False)
|
106 |
st.dataframe(final_Proj.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|
|
|
88 |
team_var1 = player_frame.Team.values.tolist()
|
89 |
pos_split1 = st.radio("Are you viewing all positions, specific groups, or specific positions?", ('All Positions', 'Specific Positions'), key='pos_split1')
|
90 |
if pos_split1 == 'Specific Positions':
|
91 |
+
pos_var1 = st.multiselect('What Positions would you like to view?', options = ['C', 'W', 'D', 'G'])
|
92 |
elif pos_split1 == 'All Positions':
|
93 |
pos_var1 = 'All'
|
94 |
+
sal_var1 = st.slider("Is there a certain price range you want to view?", 2000, 10000, (2000, 20000), key='sal_var1')
|
95 |
|
96 |
with col2:
|
97 |
final_Proj = player_frame[player_frame['Site'] == str(site_var1)]
|
|
|
100 |
final_Proj = final_Proj[final_Proj['Salary'] <= sal_var1[1]]
|
101 |
if pos_var1 != 'All':
|
102 |
final_Proj = final_Proj[final_Proj['Position'].str.contains('|'.join(pos_var1))]
|
103 |
+
final_Proj = final_Proj.set_index('Player')
|
104 |
+
final_Proj = final_Proj.sort_values(by='Median', ascending=False)
|
105 |
+
if pos_var1 == 'All':
|
106 |
final_Proj = final_Proj.set_index('Player')
|
107 |
final_Proj = final_Proj.sort_values(by='Median', ascending=False)
|
108 |
st.dataframe(final_Proj.style.background_gradient(axis=0).background_gradient(cmap='RdYlGn').format(precision=2), use_container_width = True)
|