Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -84,36 +84,41 @@ co = matplotlib.colors.LinearSegmentedColormap.from_list("", ["#56B4E9","#FFFFFF
|
|
84 |
|
85 |
|
86 |
|
87 |
-
try:
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
except KeyError:
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
total_list = []
|
96 |
-
|
97 |
-
for x in data_r['fantasy_content']['league']['players']:
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
yahoo_df =
|
|
|
|
|
|
|
|
|
|
|
117 |
|
118 |
# yahoo_df = pd.read_csv('df_2023_small.csv',index_col=[0],usecols=range(12))
|
119 |
# yahoo_df.columns = ['rank_value','player_id','full','first','last','average_pick', 'average_cost','display_position','projected_auction_value','editorial_team_abbr','percent_owned']
|
|
|
84 |
|
85 |
|
86 |
|
87 |
+
# try:
|
88 |
+
# 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()
|
89 |
+
# key_check = data_r['fantasy_content']['league']['players']
|
90 |
+
|
91 |
+
# except KeyError:
|
92 |
+
# 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=400;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()
|
93 |
+
# print('key_checked')
|
94 |
+
|
95 |
+
# total_list = []
|
96 |
+
|
97 |
+
# for x in data_r['fantasy_content']['league']['players']:
|
98 |
+
# single_list = []
|
99 |
+
|
100 |
+
# single_list.append(int(x['player']['player_id']))
|
101 |
+
# single_list.append(int(x['player']['player_ranks'][0]['player_rank']['rank_value']))
|
102 |
+
# single_list.append(x['player']['name']['full'])
|
103 |
+
# single_list.append(x['player']['name']['first'])
|
104 |
+
# single_list.append(x['player']['name']['last'])
|
105 |
+
# single_list.append(x['player']['draft_analysis']['average_pick'])
|
106 |
+
# single_list.append(x['player']['average_auction_cost'])
|
107 |
+
# single_list.append(x['player']['display_position'])
|
108 |
+
# single_list.append(x['player']['editorial_team_abbr'])
|
109 |
+
# if 'value' in x['player']['percent_owned']:
|
110 |
+
# single_list.append(x['player']['percent_owned']['value']/100)
|
111 |
+
# else:
|
112 |
+
# single_list.append(0)
|
113 |
+
# total_list.append(single_list)
|
114 |
+
|
115 |
+
yahoo_df = pd.read_csv('df_2023_small.csv',index_col=[0])
|
116 |
+
yahoo_df.percent_owned = yahoo_df.percent_owned.astype(float)
|
117 |
+
#yahoo_df_scrape.columns = ['yahoo_id','idx','full','first','last','average_pick','average_auction_cost','projected_auction_value','position','team','percent_owned','status']
|
118 |
+
#yahoo_df_scrape.status = yahoo_df_scrape.status.astype(str)
|
119 |
+
|
120 |
+
|
121 |
+
#yahoo_df = pd.DataFrame(total_list,columns = ['player_id','rank_value','full','first','last','average_pick','average_auction_cost','display_position','editorial_team_abbr','percent_owned'])
|
122 |
|
123 |
# yahoo_df = pd.read_csv('df_2023_small.csv',index_col=[0],usecols=range(12))
|
124 |
# yahoo_df.columns = ['rank_value','player_id','full','first','last','average_pick', 'average_cost','display_position','projected_auction_value','editorial_team_abbr','percent_owned']
|