nesticot commited on
Commit
5f2d128
·
verified ·
1 Parent(s): 2f65a70

Update batter_scatter.py

Browse files
Files changed (1) hide show
  1. batter_scatter.py +3 -3
batter_scatter.py CHANGED
@@ -249,9 +249,9 @@ def server(input,output,session):
249
  print(len(data_df))
250
  if input.names():
251
  for i in range(len(data_df)):
252
- if (data_df[input.stat_x()+'_percent'][i] < input.n_percent_bot_x() or data_df[input.stat_x()+'_percent'][i] > 1 - input.n_percent_top_x() ) \
253
- or (data_df[input.stat_y()+'_percent'][i] < input.n_percent_bot_y() or data_df[input.stat_y()+'_percent'][i] > 1 -input.n_percent_top_y()) \
254
- or (data_df[input.stat_z()+'_percent'][i] < input.n_percent_bot_z() or data_df[input.stat_z()+'_percent'][i] > 1 -input.n_percent_top_z() )\
255
  or (str(data_df.batter_id[i]) in (input.player_id())):
256
  # print(data_df.batter[i])
257
  # ax.annotate(data_df.batter[i], xy=((data_df[input.stat_x()][i])+0.025/batter_dict_stat[input.stat_x()]['percent_adjust'], data_df[input.stat_y()][i]+0.01/batter_dict_stat[input.stat_x()]['percent_adjust']), xytext=(-20,20),
 
249
  print(len(data_df))
250
  if input.names():
251
  for i in range(len(data_df)):
252
+ if (data_df[input.stat_x()+'_percent'].values[i] < input.n_percent_bot_x() or data_df[input.stat_x()+'_percent'].values[i] > 1 - input.n_percent_top_x() ) \
253
+ or (data_df[input.stat_y()+'_percent'].values[i] < input.n_percent_bot_y() or data_df[input.stat_y()+'_percent'].values[i] > 1 -input.n_percent_top_y()) \
254
+ or (data_df[input.stat_z()+'_percent'].values[i] < input.n_percent_bot_z() or data_df[input.stat_z()+'_percent'].values[i] > 1 -input.n_percent_top_z() )\
255
  or (str(data_df.batter_id[i]) in (input.player_id())):
256
  # print(data_df.batter[i])
257
  # ax.annotate(data_df.batter[i], xy=((data_df[input.stat_x()][i])+0.025/batter_dict_stat[input.stat_x()]['percent_adjust'], data_df[input.stat_y()][i]+0.01/batter_dict_stat[input.stat_x()]['percent_adjust']), xytext=(-20,20),