From 9a327b83059cb3500b6aaa24b10819c61d24d38c Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 29 Jul 2021 22:12:14 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index 2a7afb3..b8245aa 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1769,19 +1769,17 @@ def kernel_30(o_29, ids=None, delay=None,): 70 ) elif ids == 'v2': - t8 = numpy.where( - numpy.stack( - [ - o_29['t5'].portion > 0.1, - o_29['t5'].mean_conf > 0.6, - o_29['t5']['t11'].data, - ], - axis=0 - ).prod(axis=0) - )[0] + t8 = numpy.stack( + [ + o_29['t5'].portion > 0.1, + o_29['t5'].mean_conf > 0.6, + o_29['t5']['t11'].data, + ], + axis=0 + ).prod(axis=0) pprint.pprint([t8.sum(), t8.mean()]) ids = numpy.random.choice( - t8, + numpy.where(t8)[0], min(70, len(t8)), ) else: