Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -46,6 +46,17 @@ 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 |
@st.cache_resource(ttl = 299)
|
50 |
def init_baselines():
|
51 |
sh = gcservice_account.open_by_url(master_hold)
|
@@ -639,8 +650,12 @@ with tab6:
|
|
639 |
elif split_var6 == 'All':
|
640 |
team_var6 = player_stats.Team.values.tolist()
|
641 |
raw_stats_disp = raw_baselines[raw_baselines['Team'].isin(team_var6)]
|
642 |
-
|
643 |
-
|
|
|
|
|
|
|
|
|
644 |
st.download_button(
|
645 |
label="Export Customizable Model",
|
646 |
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_c(new_df: pd.DataFrame | None = None):
|
50 |
+
if new_df is not None:
|
51 |
+
if new_df.equals(raw_stats_disp):
|
52 |
+
return
|
53 |
+
raw_stats_disp = new_df
|
54 |
+
|
55 |
+
df = raw_stats_disp
|
56 |
+
df["2P"] = df["Minutes"] + df["FG2M"]
|
57 |
+
raw_stats_disp = df
|
58 |
+
st.experimental_rerun()
|
59 |
+
|
60 |
@st.cache_resource(ttl = 299)
|
61 |
def init_baselines():
|
62 |
sh = gcservice_account.open_by_url(master_hold)
|
|
|
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 |
+
editable_df = st.data_editor(
|
654 |
+
raw_stats_disp,
|
655 |
+
key="data",
|
656 |
+
hide_index=True,
|
657 |
+
)
|
658 |
+
add_c(editable_df)
|
659 |
st.download_button(
|
660 |
label="Export Customizable Model",
|
661 |
data=convert_df_to_csv(player_stats),
|