Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -190,6 +190,7 @@ app_ui = ui.page_fluid(
|
|
190 |
ui.input_numeric("n_2", "Last Games y", value=0),
|
191 |
ui.input_numeric("n_3", "Last Games z", value=0),
|
192 |
ui.input_numeric("top_n", "Show top 'n'", value=10),
|
|
|
193 |
#ui.input_select("ignore_id", "Remove Columns",['Position','Roster%'],multiple=True,selectize=True),
|
194 |
),
|
195 |
|
@@ -323,6 +324,10 @@ def server(input, output, session):
|
|
323 |
test = test.merge(right=yahoo_df,left_on='player_id',right_on='nhl_id',suffixes=['','_y'],how='left')
|
324 |
|
325 |
|
|
|
|
|
|
|
|
|
326 |
print('Column List')
|
327 |
print(test.columns)
|
328 |
|
@@ -333,7 +338,11 @@ def server(input, output, session):
|
|
333 |
test = test.rename(columns={'display_position':'Position'})
|
334 |
|
335 |
|
336 |
-
top_d_score = test[(test.Team==input.team_id())].sort_values(by=['L'+str(n_1)+' PP%'],ascending=False).reset_index(drop=True)
|
|
|
|
|
|
|
|
|
337 |
top_d_score = top_d_score.head(min(len(top_d_score),top_n))
|
338 |
|
339 |
|
|
|
190 |
ui.input_numeric("n_2", "Last Games y", value=0),
|
191 |
ui.input_numeric("n_3", "Last Games z", value=0),
|
192 |
ui.input_numeric("top_n", "Show top 'n'", value=10),
|
193 |
+
ui.input_switch("x", "Switch input"),
|
194 |
#ui.input_select("ignore_id", "Remove Columns",['Position','Roster%'],multiple=True,selectize=True),
|
195 |
),
|
196 |
|
|
|
324 |
test = test.merge(right=yahoo_df,left_on='player_id',right_on='nhl_id',suffixes=['','_y'],how='left')
|
325 |
|
326 |
|
327 |
+
test.loc[test.display_position.isna(),'display_position'] = test.loc[test.display_position.isna(),'Position']
|
328 |
+
test.percent_owned = test.percent_owned.fillna(0)
|
329 |
+
|
330 |
+
|
331 |
print('Column List')
|
332 |
print(test.columns)
|
333 |
|
|
|
338 |
test = test.rename(columns={'display_position':'Position'})
|
339 |
|
340 |
|
341 |
+
top_d_score = test[(test.Team==input.team_id())].sort_values(by=['L'+str(n_1)+' PP%'],ascending=False).reset_index(drop=True)
|
342 |
+
|
343 |
+
if input.x()
|
344 |
+
top_d_score = top_d_score.dropna(axis='columns')
|
345 |
+
|
346 |
top_d_score = top_d_score.head(min(len(top_d_score),top_n))
|
347 |
|
348 |
|