Created
March 6, 2018 04:16
-
-
Save micahmelling/98377980eed59edad83840b998ee5c65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| last_row_df = at_bat_results.tail(1) | |
| if last_row_df['swing'].any() == 'yes': | |
| end_of_at_bat = np.random.choice(a=['yes', 'no'], p=[swing_produces_out, 1 - swing_produces_out]) | |
| else: | |
| end_of_at_bat = 'no' | |
| if at_bat_results['result'].any() == 'no_hit' and end_of_at_bat == 'no': | |
| new_count = np.random.choice(a=['0-1', '1-0'], p=[0.50, 0.50]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment