Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you really want the second bit of code in the same function as the first, you could just paste all but the part where you set the over_count and under_count into the function...</p> <pre><code>def overunder(n): over_count = 0 under_count = 0 push_count = 0 overodds = 0 underodds = 0 for i in range(n): if round(np.random.normal(pjTotal3s,pjGame3STD)) &gt; threes_over: over_count = over_count + 1 if round(np.random.normal(pjTotal3s,pjGame3STD)) &lt; threes_over: under_count = under_count +1 if round(np.random.normal(pjTotal3s,pjGame3STD)) == threes_over: push_count = push_count + 1 over = 1/(over_count / float(over_count + under_count)) under = 1/ (under_count / float(over_count + under_count)) over_odds_given = 1.77 under_odds_given = 2.05 overedge = 1/over * over_odds_given - 1 underedge = 1/under * under_odds_given - 1 print overedge, underedge return over_count, under_count, push_count </code></pre> <p>Or, probably better, you could put the second bit of code (overedge, underedge) into a separate function and pass it the results from overunder:</p> <pre><code>def edges(over_count, under_count, push_count): over = 1/(over_count / float(over_count + under_count)) under = 1/ (under_count / float(over_count + under_count)) over_odds_given = 1.77 under_odds_given = 2.05 overedge = 1/over * over_odds_given - 1 underedge = 1/under * under_odds_given - 1 print overedge, underedge </code></pre> <p>And then call it with the results from overunder:</p> <pre><code>c = overunder(100000) edges(c[0],c[1],c[2]) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload