Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -179,7 +179,7 @@ player_games_df_2 = player_games_df_old.copy()
|
|
179 |
team_games_df['game_count'] = team_games_df.groupby('team')['team'].cumcount()+1
|
180 |
team_games_df['max_games'] = team_games_df.groupby('team').game_count.transform('max')
|
181 |
team_games_df['abv'] = team_games_df.team.map(team_abv.set_index('team_name')['team_abv'].to_dict())
|
182 |
-
|
183 |
#team_abv = pd.read_csv('team_abv.csv')
|
184 |
|
185 |
|
@@ -290,20 +290,20 @@ def server(input, output, session):
|
|
290 |
list_of_columns_name.remove(f'L{str(n_3)} PP%')
|
291 |
|
292 |
|
293 |
-
|
294 |
start_date ='2023-09-01'
|
295 |
end_date = '2024-05-01'
|
296 |
player_games_df = player_games_df_2.copy()
|
297 |
player_games_df = player_games_df.merge(right=team_games_df,left_on=['Team','date'],right_on=['abv','date'])
|
298 |
|
299 |
df_pp_1 = player_games_df.groupby('Player').head(n_1)
|
300 |
-
df_pp_1 = df_pp_1[df_pp_1.game_count
|
301 |
|
302 |
df_pp_2 = df_pp_2 = player_games_df.groupby('Player').head(n_2)
|
303 |
-
df_pp_2[df_pp_2.game_count
|
304 |
|
305 |
df_pp_3 = df_pp_3 = player_games_df.groupby('Player').head(n_3)
|
306 |
-
df_pp_3[df_pp_3.game_count
|
307 |
|
308 |
team_games_df_1 = team_games_df.groupby('team').head(n_1)
|
309 |
team_games_df_2 = team_games_df.groupby('team').head(n_2)
|
|
|
179 |
team_games_df['game_count'] = team_games_df.groupby('team')['team'].cumcount()+1
|
180 |
team_games_df['max_games'] = team_games_df.groupby('team').game_count.transform('max')
|
181 |
team_games_df['abv'] = team_games_df.team.map(team_abv.set_index('team_name')['team_abv'].to_dict())
|
182 |
+
team_games_df = team_games_df.sort_values(by='game_count',ascending=False)
|
183 |
#team_abv = pd.read_csv('team_abv.csv')
|
184 |
|
185 |
|
|
|
290 |
list_of_columns_name.remove(f'L{str(n_3)} PP%')
|
291 |
|
292 |
|
293 |
+
|
294 |
start_date ='2023-09-01'
|
295 |
end_date = '2024-05-01'
|
296 |
player_games_df = player_games_df_2.copy()
|
297 |
player_games_df = player_games_df.merge(right=team_games_df,left_on=['Team','date'],right_on=['abv','date'])
|
298 |
|
299 |
df_pp_1 = player_games_df.groupby('Player').head(n_1)
|
300 |
+
df_pp_1 = df_pp_1[df_pp_1.game_count >= df_pp_1.max_games-n_1]
|
301 |
|
302 |
df_pp_2 = df_pp_2 = player_games_df.groupby('Player').head(n_2)
|
303 |
+
df_pp_2[df_pp_2.game_count >= df_pp_2.max_games-n_2]
|
304 |
|
305 |
df_pp_3 = df_pp_3 = player_games_df.groupby('Player').head(n_3)
|
306 |
+
df_pp_3[df_pp_3.game_count >= df_pp_3.max_games-n_3]
|
307 |
|
308 |
team_games_df_1 = team_games_df.groupby('team').head(n_1)
|
309 |
team_games_df_2 = team_games_df.groupby('team').head(n_2)
|