Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -46,16 +46,11 @@ prop_table_options = ['points', 'threes', 'rebounds', 'assists', 'blocks', 'stea
|
|
46 |
all_sim_vars = ['points', 'rebounds', 'assists', 'threes', 'PRA', 'points+rebounds', 'points+assists', 'rebounds+assists']
|
47 |
sim_all_hold = pd.DataFrame(columns=['Player', 'Prop type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Over%', 'Imp Under', 'Under%', 'Bet?', 'Edge'])
|
48 |
|
49 |
-
def
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
df = st.session_state["raw_stats_disp"]
|
56 |
-
df["2P"] = df["Minutes"] + df["FG2M"]
|
57 |
-
st.session_state["raw_stats_disp"] = df
|
58 |
-
st.experimental_rerun()
|
59 |
|
60 |
@st.cache_resource(ttl = 299)
|
61 |
def init_baselines():
|
@@ -650,16 +645,12 @@ with tab6:
|
|
650 |
elif split_var6 == 'All':
|
651 |
team_var6 = player_stats.Team.values.tolist()
|
652 |
raw_stats_disp = raw_baselines[raw_baselines['Team'].isin(team_var6)]
|
653 |
-
if "raw_stats_disp" not in st.session_state:
|
654 |
-
st.session_state.raw_stats_disp = raw_stats_disp
|
655 |
-
add_c()
|
656 |
-
|
657 |
editable_df = st.data_editor(
|
658 |
raw_stats_disp,
|
659 |
key="data",
|
660 |
hide_index=True,
|
661 |
)
|
662 |
-
|
663 |
st.download_button(
|
664 |
label="Export Customizable Model",
|
665 |
data=convert_df_to_csv(player_stats),
|
|
|
46 |
all_sim_vars = ['points', 'rebounds', 'assists', 'threes', 'PRA', 'points+rebounds', 'points+assists', 'rebounds+assists']
|
47 |
sim_all_hold = pd.DataFrame(columns=['Player', 'Prop type', 'Prop', 'Mean_Outcome', 'Imp Over', 'Over%', 'Imp Under', 'Under%', 'Bet?', 'Edge'])
|
48 |
|
49 |
+
def add_column(df):
|
50 |
+
return_df = df
|
51 |
+
return_df = return_df["Minutes"] * return_df["FG2M"]
|
52 |
+
|
53 |
+
return return_df
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
@st.cache_resource(ttl = 299)
|
56 |
def init_baselines():
|
|
|
645 |
elif split_var6 == 'All':
|
646 |
team_var6 = player_stats.Team.values.tolist()
|
647 |
raw_stats_disp = raw_baselines[raw_baselines['Team'].isin(team_var6)]
|
|
|
|
|
|
|
|
|
648 |
editable_df = st.data_editor(
|
649 |
raw_stats_disp,
|
650 |
key="data",
|
651 |
hide_index=True,
|
652 |
)
|
653 |
+
st.dataframe(add_column(editable_df))
|
654 |
st.download_button(
|
655 |
label="Export Customizable Model",
|
656 |
data=convert_df_to_csv(player_stats),
|