Spaces:
Running
Running
James McCool
commited on
Commit
·
fdea0d5
1
Parent(s):
0a08e64
added poisson math to player prop sims
Browse files
app.py
CHANGED
@@ -342,12 +342,14 @@ with tab4:
|
|
342 |
player_outcomes = pd.merge(players_only, overall_file, left_index=True, right_index=True)
|
343 |
|
344 |
players_only['Mean_Outcome'] = overall_file.mean(axis=1)
|
|
|
|
|
345 |
players_only['10%'] = overall_file.quantile(0.1, axis=1)
|
346 |
players_only['90%'] = overall_file.quantile(0.9, axis=1)
|
347 |
if ou_var == 'Over':
|
348 |
-
players_only['beat_prop'] = overall_file[overall_file > prop_var].count(axis=1)/float(total_sims)
|
349 |
elif ou_var == 'Under':
|
350 |
-
players_only['beat_prop'] = (overall_file[overall_file < prop_var].count(axis=1)/float(total_sims))
|
351 |
|
352 |
players_only['implied_odds'] = np.where(line_var <= 0, (-(line_var)/((-(line_var))+100)), 100/(line_var+100))
|
353 |
|
|
|
342 |
player_outcomes = pd.merge(players_only, overall_file, left_index=True, right_index=True)
|
343 |
|
344 |
players_only['Mean_Outcome'] = overall_file.mean(axis=1)
|
345 |
+
players_only['Prop'] = prop_var
|
346 |
+
players_only['poisson_var'] = players_only.apply(calculate_poisson, axis=1)
|
347 |
players_only['10%'] = overall_file.quantile(0.1, axis=1)
|
348 |
players_only['90%'] = overall_file.quantile(0.9, axis=1)
|
349 |
if ou_var == 'Over':
|
350 |
+
players_only['beat_prop'] = np.where(overall_file['Prop'] <= 3, players_only['poisson_var'], overall_file[overall_file > prop_var].count(axis=1)/float(total_sims))
|
351 |
elif ou_var == 'Under':
|
352 |
+
players_only['beat_prop'] = np.where(overall_file['Prop'] <= 3, 1 - players_only['poisson_var'], (overall_file[overall_file < prop_var].count(axis=1)/float(total_sims)))
|
353 |
|
354 |
players_only['implied_odds'] = np.where(line_var <= 0, (-(line_var)/((-(line_var))+100)), 100/(line_var+100))
|
355 |
|