Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -166,8 +166,13 @@ schedule_stack['away_b2b'] = schedule_stack['away_b2b'].replace(0,'')
|
|
166 |
schedule_stack.head()
|
167 |
|
168 |
FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc')
|
|
|
|
|
|
|
169 |
|
170 |
-
|
|
|
|
|
171 |
|
172 |
total_list = []
|
173 |
|
@@ -181,6 +186,7 @@ for x in data_r['fantasy_content']['league']['players']:
|
|
181 |
single_list.append(x['player']['name']['last'])
|
182 |
single_list.append(x['player']['draft_analysis']['average_pick'])
|
183 |
single_list.append(x['player']['average_auction_cost'])
|
|
|
184 |
single_list.append(x['player']['display_position'])
|
185 |
single_list.append(x['player']['editorial_team_abbr'])
|
186 |
if 'value' in x['player']['percent_owned']:
|
@@ -189,6 +195,7 @@ for x in data_r['fantasy_content']['league']['players']:
|
|
189 |
single_list.append(0)
|
190 |
total_list.append(single_list)
|
191 |
|
|
|
192 |
df_2023 = pd.DataFrame(data=total_list,columns=['player_id','rank_value','full','first','last','average_pick', 'average_cost','display_position','editorial_team_abbr','percent_owned'])
|
193 |
|
194 |
week_dict = yahoo_weeks.set_index('Number')['Week'].sort_index().to_dict()
|
|
|
166 |
schedule_stack.head()
|
167 |
|
168 |
FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc')
|
169 |
+
try:
|
170 |
+
data_r = requests.get("https://pub-api-ro.fantasysports.yahoo.com/fantasy/v2/league/427.l.public;out=settings/players;position=ALL;start=0;count=3000;sort=rank_season;search=;out=percent_owned;out=auction_values,ranks;ranks=season;ranks_by_position=season;out=expert_ranks;expert_ranks.rank_type=projected_season_remaining/draft_analysis;cut_types=diamond;slices=last7days?format=json_f").json()
|
171 |
+
key_check = data_r['fantasy_content']['league']['players']
|
172 |
|
173 |
+
except KeyError:
|
174 |
+
data_r = requests.get("https://pub-api-ro.fantasysports.yahoo.com/fantasy/v2/league/427.l.public;out=settings/players;position=ALL;start=0;count=1151;sort=rank_season;search=;out=percent_owned;out=auction_values,ranks;ranks=season;ranks_by_position=season;out=expert_ranks;expert_ranks.rank_type=projected_season_remaining/draft_analysis;cut_types=diamond;slices=last7days?format=json_f").json()
|
175 |
+
print('key_checked')
|
176 |
|
177 |
total_list = []
|
178 |
|
|
|
186 |
single_list.append(x['player']['name']['last'])
|
187 |
single_list.append(x['player']['draft_analysis']['average_pick'])
|
188 |
single_list.append(x['player']['average_auction_cost'])
|
189 |
+
single_list.append(x['player']['projected_auction_value'])
|
190 |
single_list.append(x['player']['display_position'])
|
191 |
single_list.append(x['player']['editorial_team_abbr'])
|
192 |
if 'value' in x['player']['percent_owned']:
|
|
|
195 |
single_list.append(0)
|
196 |
total_list.append(single_list)
|
197 |
|
198 |
+
|
199 |
df_2023 = pd.DataFrame(data=total_list,columns=['player_id','rank_value','full','first','last','average_pick', 'average_cost','display_position','editorial_team_abbr','percent_owned'])
|
200 |
|
201 |
week_dict = yahoo_weeks.set_index('Number')['Week'].sort_index().to_dict()
|