From 8c78463d1bd73b669e3cc0c0ff50d6612fc1919d Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Mon, 2 Aug 2021 14:17:51 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index cb7cce9..a52d348 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1850,14 +1850,16 @@ def kernel_30( 10 ) elif ids == 'v1': + t8 = numpy.where( + numpy.logical_and( + o_29['t5'].portion > 0.1, + o_29['t5'].mean_conf > 0.6 + ) + )[0] ids = numpy.random.choice( - numpy.where( - numpy.logical_and( - o_29['t5'].portion > 0.1, - o_29['t5'].mean_conf > 0.6 - ) - )[0], - 70 + t8, + min(len(t8), 70), + replace=False, ) elif ids == 'v2': t8 = numpy.stack(