James McCool commited on
Commit
1ea09c5
1 Parent(s): 636246c

dropping duplicates on init_load for pick6

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -127,6 +127,8 @@ def init_baselines():
127
  raw_display = pd.DataFrame(worksheet.get_all_records())
128
  raw_display.replace('', np.nan, inplace=True)
129
  pick_frame = raw_display.dropna(subset='Player')
 
 
130
 
131
  prop_frame['Player'].replace(['Jaren Jackson', 'Nic Claxton', 'Jabari Smith', 'Lu Dort', 'Moe Wagner', 'Kyle Kuzma', 'Trey Murphy', 'Cameron Thomas'],
132
  ['Jaren Jackson Jr.', 'Nicolas Claxton', 'Jabari Smith Jr.', 'Luguentz Dort', 'Moritz Wagner', 'Kyle Kuzma Jr.',
@@ -427,6 +429,7 @@ with tab5:
427
  prop_df = prop_df.loc[prop_df['prop_type'] == prop]
428
  prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line']]
429
  prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
 
430
  prop_df = prop_df.sort_values(by='Prop', ascending=False)
431
  prop_df = prop_df.drop_duplicates(subset=['Player'], keep='first')
432
  prop_df = prop_df.reset_index(drop=True)
@@ -439,8 +442,6 @@ with tab5:
439
  over_dict = dict(zip(prop_df.Player, prop_df.Over))
440
  under_dict = dict(zip(prop_df.Player, prop_df.Under))
441
 
442
- st.table(prop_df)
443
-
444
  df = pd.merge(player_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
445
  df = df.reset_index(drop=True)
446
  team_dict = dict(zip(df.Player, df.Team))
 
127
  raw_display = pd.DataFrame(worksheet.get_all_records())
128
  raw_display.replace('', np.nan, inplace=True)
129
  pick_frame = raw_display.dropna(subset='Player')
130
+ pick_frame = pick_frame.drop_duplicates(subset=['Player'], keep='first')
131
+ pick_frame = pick_frame.reset_index(drop=True)
132
 
133
  prop_frame['Player'].replace(['Jaren Jackson', 'Nic Claxton', 'Jabari Smith', 'Lu Dort', 'Moe Wagner', 'Kyle Kuzma', 'Trey Murphy', 'Cameron Thomas'],
134
  ['Jaren Jackson Jr.', 'Nicolas Claxton', 'Jabari Smith Jr.', 'Luguentz Dort', 'Moritz Wagner', 'Kyle Kuzma Jr.',
 
429
  prop_df = prop_df.loc[prop_df['prop_type'] == prop]
430
  prop_df = prop_df[['Player', 'book', 'over_prop', 'over_line', 'under_line']]
431
  prop_df.rename(columns={"over_prop": "Prop"}, inplace = True)
432
+ st.table(prop_df)
433
  prop_df = prop_df.sort_values(by='Prop', ascending=False)
434
  prop_df = prop_df.drop_duplicates(subset=['Player'], keep='first')
435
  prop_df = prop_df.reset_index(drop=True)
 
442
  over_dict = dict(zip(prop_df.Player, prop_df.Over))
443
  under_dict = dict(zip(prop_df.Player, prop_df.Under))
444
 
 
 
445
  df = pd.merge(player_stats, prop_df, how='left', left_on=['Player'], right_on = ['Player'])
446
  df = df.reset_index(drop=True)
447
  team_dict = dict(zip(df.Player, df.Team))