Spaces:
Running
Running
| import streamlit as st | |
| from numpy import nan as np_nan | |
| from numpy import where as np_where | |
| from numpy import random as np_random | |
| from numpy import zeros as np_zeros | |
| from numpy import array as np_array | |
| from pandas import concat as pd_concat | |
| from pandas import merge as pd_merge | |
| from pandas import DataFrame | |
| def moneyline_to_probability(moneyline): | |
| if moneyline > 0: | |
| return 100 / (moneyline + 100) | |
| else: | |
| return abs(moneyline) / (abs(moneyline) + 100) | |
| def DK_MMA_ROO_Build(projections_file, std_var, distribution_type): | |
| total_sims = 1000 | |
| projects_raw = projections_file.copy() | |
| projects_raw = projects_raw.replace(np_nan, "") | |
| mask = projects_raw['KO_odds'] == "" | |
| projects_raw.loc[mask, 'KO_odds'] = (200 - projects_raw.loc[mask, 'Median']) * 10 | |
| mask = projects_raw['Sub_odds'] == "" | |
| projects_raw.loc[mask, 'Sub_odds'] = (200 - projects_raw.loc[mask, 'Median']) * 10 | |
| projects_raw['range_initial'] = np_where(projects_raw['KO_odds'] < projects_raw['Sub_odds'], projects_raw['KO_odds'], projects_raw['Sub_odds']) | |
| projects_raw['range_var'] = projects_raw['range_initial'].apply(moneyline_to_probability) | |
| dk_df = projects_raw.sort_values(by='Median', ascending=False) | |
| basic_own_df = dk_df.copy() | |
| def calculate_ownership(df): | |
| # Filter the dataframe based on the position | |
| frame = df.copy() | |
| # Calculate Small Field Own% | |
| frame['Base Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (5 * (frame['Own'] - (frame['Own'].mean() / 1.5)) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Base Own%'] = np_where( | |
| frame['Base Own%'] > 85, | |
| 85, | |
| frame['Base Own%'] | |
| ) | |
| # Calculate Small Field Own% | |
| frame['Small Field Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (6 * (frame['Own'] - frame['Own'].mean()) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Small Field Own%'] = np_where( | |
| frame['Small Field Own%'] > 85, | |
| 85, | |
| frame['Small Field Own%'] | |
| ) | |
| # Calculate Large Field Own% | |
| frame['Large Field Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (2.5 * (frame['Own'] - frame['Own'].mean()) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Large Field Own%'] = np_where( | |
| frame['Large Field Own%'] > 85, | |
| 85, | |
| frame['Large Field Own%'] | |
| ) | |
| # Calculate Cash Own% | |
| frame['Cash Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (8 * (frame['Own'] - frame['Own'].mean()) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Cash Own%'] = np_where( | |
| frame['Cash Own%'] > 85, | |
| 85, | |
| frame['Cash Own%'] | |
| ) | |
| return frame | |
| # Apply the function to each dataframe | |
| basic_own_df = calculate_ownership(basic_own_df) | |
| own_norm_var_reg = 600 / basic_own_df['Own'].sum() | |
| own_norm_var_small = 600 / basic_own_df['Small Field Own%'].sum() | |
| own_norm_var_large = 600 / basic_own_df['Large Field Own%'].sum() | |
| own_norm_var_cash = 600 / basic_own_df['Cash Own%'].sum() | |
| basic_own_df['Own'] = basic_own_df['Own'] * own_norm_var_reg | |
| basic_own_df['Small_Own'] = basic_own_df['Small Field Own%'] * own_norm_var_small | |
| basic_own_df['Large_Own'] = basic_own_df['Large Field Own%'] * own_norm_var_large | |
| basic_own_df['Cash_Own'] = basic_own_df['Cash Own%'] * own_norm_var_cash | |
| basic_own_df['Own'] = np_where(basic_own_df['Own'] > 90, 90, basic_own_df['Own']) | |
| # Apply the function to each dataframe | |
| basic_own_df = calculate_ownership(basic_own_df) | |
| own_norm_var_reg = 600 / basic_own_df['Own'].sum() | |
| own_norm_var_small = 600 / basic_own_df['Small Field Own%'].sum() | |
| own_norm_var_large = 600 / basic_own_df['Large Field Own%'].sum() | |
| own_norm_var_cash = 600 / basic_own_df['Cash Own%'].sum() | |
| basic_own_df['Own'] = basic_own_df['Own'] * own_norm_var_reg | |
| basic_own_df['Small_Own'] = basic_own_df['Small Field Own%'] * own_norm_var_small | |
| basic_own_df['Large_Own'] = basic_own_df['Large Field Own%'] * own_norm_var_large | |
| basic_own_df['Cash_Own'] = basic_own_df['Cash Own%'] * own_norm_var_cash | |
| own_dict = dict(zip(basic_own_df.Player, basic_own_df.Own)) | |
| small_own_dict = dict(zip(basic_own_df.Player, basic_own_df['Small Field Own%'])) | |
| large_own_dict = dict(zip(basic_own_df.Player, basic_own_df['Large Field Own%'])) | |
| cash_own_dict = dict(zip(basic_own_df.Player, basic_own_df['Cash Own%'])) | |
| ko_dict = dict(zip(basic_own_df.Player, basic_own_df.KO_odds)) | |
| sub_dict = dict(zip(basic_own_df.Player, basic_own_df.Sub_odds)) | |
| flex_file = basic_own_df[['Player', 'Salary', 'Median', 'KO_odds', 'Sub_odds', 'range_var']] | |
| flex_file = flex_file.rename(columns={"Agg": "Median"}) | |
| # flex_file['Median'] = (flex_file['Median'] * (1 - flex_file['range_var'])) | |
| flex_file['Floor'] = flex_file['Median'] * (1-flex_file['range_var']) | |
| flex_file['Ceiling'] = flex_file['Median'] * (1+flex_file['range_var']) | |
| flex_file['STD'] = (flex_file['Median'] / std_var) | |
| flex_file = flex_file[['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'STD']] | |
| flex_file = flex_file.reset_index(drop=True) | |
| hold_file = flex_file.copy() | |
| overall_file = flex_file.copy() | |
| salary_file = flex_file.copy() | |
| try: | |
| overall_floor_gpu = np_array(overall_file['Floor']) | |
| overall_ceiling_gpu = np_array(overall_file['Ceiling']) | |
| overall_median_gpu = np_array(overall_file['Median']) | |
| overall_std_gpu = np_array(overall_file['STD']) | |
| overall_salary_gpu = np_array(overall_file['Salary']) | |
| data_shape = (len(overall_file['Player']), total_sims) # Example: 1000 rows | |
| salary_array = np_zeros(data_shape) | |
| sim_array = np_zeros(data_shape) | |
| for x in range(0, total_sims): | |
| result_gpu = overall_salary_gpu | |
| salary_array[:, x] = result_gpu | |
| cupy_array = salary_array | |
| salary_file = salary_file.reset_index(drop=True) | |
| salary_cupy = DataFrame(cupy_array, columns=list(range(0, total_sims))) | |
| salary_check_file = pd_concat([salary_file, salary_cupy], axis=1) | |
| except: | |
| for x in range(0,total_sims): | |
| salary_file[x] = salary_file['Salary'] | |
| salary_check_file = salary_file.copy() | |
| salary_file=salary_check_file.drop(['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1) | |
| salary_file = salary_file.div(1000) | |
| try: | |
| for x in range(0, total_sims): | |
| if distribution_type == 'normal': | |
| # Normal distribution (existing logic) | |
| result_gpu = np_random.normal(overall_median_gpu, overall_std_gpu) | |
| elif distribution_type == 'poisson': | |
| # Poisson distribution - using median as lambda | |
| result_gpu = np_random.poisson(overall_median_gpu) | |
| elif distribution_type == 'bimodal': | |
| # Bimodal distribution - mixture of two normal distributions | |
| # First peak centered at 80% of median, second at 120% of median | |
| if np_random.random() < 0.5: | |
| result_gpu = np_random.normal(overall_floor_gpu, overall_std_gpu) | |
| else: | |
| result_gpu = np_random.normal(overall_ceiling_gpu, overall_std_gpu) | |
| else: | |
| raise ValueError("Invalid distribution type. Must be 'normal', 'poisson', or 'bimodal'") | |
| sim_array[:, x] = result_gpu | |
| add_array = sim_array | |
| overall_file = overall_file.reset_index(drop=True) | |
| df2 = DataFrame(add_array, columns=list(range(0, total_sims))) | |
| check_file = pd_concat([overall_file, df2], axis=1) | |
| except: | |
| for x in range(0,total_sims): | |
| if distribution_type == 'normal': | |
| overall_file[x] = np_random.normal(overall_file['Median'], overall_file['STD']) | |
| elif distribution_type == 'poisson': | |
| overall_file[x] = np_random.poisson(overall_file['Median']) | |
| elif distribution_type == 'bimodal': | |
| # Bimodal distribution fallback | |
| if np_random.random() < 0.5: | |
| overall_file[x] = np_random.normal(overall_file['Floor'], overall_file['STD']) | |
| else: | |
| overall_file[x] = np_random.normal(overall_file['Ceiling'], overall_file['STD']) | |
| check_file = overall_file.copy() | |
| overall_file=check_file.drop(['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1) | |
| players_only = hold_file[['Player']] | |
| raw_lineups_file = players_only | |
| for x in range(0,total_sims): | |
| maps_dict = {'proj_map':dict(zip(hold_file.Player,overall_file[x]))} | |
| raw_lineups_file[x] = sum([raw_lineups_file['Player'].map(maps_dict['proj_map'])]) | |
| players_only[x] = raw_lineups_file[x].rank(ascending=False) | |
| players_only=players_only.drop(['Player'], axis=1) | |
| salary_10x_check = (overall_file - (salary_file*10)) | |
| salary_11x_check = (overall_file - (salary_file*11)) | |
| salary_12x_check = (overall_file - (salary_file*12)) | |
| gpp_check = (overall_file - ((salary_file*11)+10)) | |
| players_only['Average_Rank'] = players_only.mean(axis=1) | |
| players_only['Top_finish'] = players_only[players_only == 1].count(axis=1)/total_sims | |
| players_only['Top_5_finish'] = players_only[players_only <= 5].count(axis=1)/total_sims | |
| players_only['Top_10_finish'] = players_only[players_only <= 10].count(axis=1)/total_sims | |
| players_only['100+%'] = overall_file[overall_file >= 100].count(axis=1)/float(total_sims) | |
| players_only['10x%'] = salary_10x_check[salary_10x_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['11x%'] = salary_11x_check[salary_11x_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['12x%'] = salary_12x_check[salary_12x_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['GPP%'] = gpp_check[gpp_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['Player'] = hold_file[['Player']] | |
| final_outcomes = players_only[['Player', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '100+%', '10x%', '11x%', '12x%', 'GPP%']] | |
| final_Proj = pd_merge(hold_file, final_outcomes, on="Player") | |
| final_Proj = final_Proj[['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '100+%', '10x%', '11x%', '12x%', 'GPP%']] | |
| final_Proj['Own'] = final_Proj['Player'].map(own_dict) | |
| final_Proj['Small_Own'] = final_Proj['Player'].map(small_own_dict) | |
| final_Proj['Large_Own'] = final_Proj['Player'].map(large_own_dict) | |
| final_Proj['Cash_Own'] = final_Proj['Player'].map(cash_own_dict) | |
| final_Proj = final_Proj[['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '100+%', '10x%', '11x%', '12x%', 'GPP%', | |
| 'Own', 'Small_Own', 'Large_Own', 'Cash_Own']] | |
| final_Proj = final_Proj.sort_values(by='Median', ascending=False) | |
| return final_Proj.copy() | |
| def FD_MMA_ROO_Build(projections_file, std_var, distribution_type): | |
| total_sims = 1000 | |
| projects_raw = projections_file.copy() | |
| projects_raw = projects_raw.replace(np_nan, "") | |
| mask = projects_raw['KO_odds'] == "" | |
| projects_raw.loc[mask, 'KO_odds'] = (200 - projects_raw.loc[mask, 'Median']) * 10 | |
| mask = projects_raw['Sub_odds'] == "" | |
| projects_raw.loc[mask, 'Sub_odds'] = (200 - projects_raw.loc[mask, 'Median']) * 10 | |
| projects_raw['range_initial'] = np_where(projects_raw['KO_odds'] < projects_raw['Sub_odds'], projects_raw['KO_odds'], projects_raw['Sub_odds']) | |
| projects_raw['range_var'] = projects_raw['range_initial'].apply(moneyline_to_probability) | |
| fd_df = projects_raw.sort_values(by='Median', ascending=False) | |
| basic_own_df = fd_df.copy() | |
| def calculate_ownership(df): | |
| # Filter the dataframe based on the position | |
| frame = df.copy() | |
| # Calculate Small Field Own% | |
| frame['Base Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (5 * (frame['Own'] - (frame['Own'].mean() / 1.5)) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Base Own%'] = np_where( | |
| frame['Base Own%'] > 85, | |
| 85, | |
| frame['Base Own%'] | |
| ) | |
| # Calculate Small Field Own% | |
| frame['Small Field Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (6 * (frame['Own'] - frame['Own'].mean()) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Small Field Own%'] = np_where( | |
| frame['Small Field Own%'] > 85, | |
| 85, | |
| frame['Small Field Own%'] | |
| ) | |
| # Calculate Large Field Own% | |
| frame['Large Field Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (2.5 * (frame['Own'] - frame['Own'].mean()) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Large Field Own%'] = np_where( | |
| frame['Large Field Own%'] > 85, | |
| 85, | |
| frame['Large Field Own%'] | |
| ) | |
| # Calculate Cash Own% | |
| frame['Cash Own%'] = np_where( | |
| (frame['Own'] - frame['Own'].mean() >= 0), | |
| frame['Own'] * (8 * (frame['Own'] - frame['Own'].mean()) / 100) + frame['Own'].mean(), | |
| frame['Own'] | |
| ) | |
| frame['Cash Own%'] = np_where( | |
| frame['Cash Own%'] > 85, | |
| 85, | |
| frame['Cash Own%'] | |
| ) | |
| return frame | |
| # Apply the function to each dataframe | |
| basic_own_df = calculate_ownership(basic_own_df) | |
| own_norm_var_reg = 600 / basic_own_df['Own'].sum() | |
| own_norm_var_small = 600 / basic_own_df['Small Field Own%'].sum() | |
| own_norm_var_large = 600 / basic_own_df['Large Field Own%'].sum() | |
| own_norm_var_cash = 600 / basic_own_df['Cash Own%'].sum() | |
| basic_own_df['Own'] = basic_own_df['Own'] * own_norm_var_reg | |
| basic_own_df['Small_Own'] = basic_own_df['Small Field Own%'] * own_norm_var_small | |
| basic_own_df['Large_Own'] = basic_own_df['Large Field Own%'] * own_norm_var_large | |
| basic_own_df['Cash_Own'] = basic_own_df['Cash Own%'] * own_norm_var_cash | |
| basic_own_df['Own'] = np_where(basic_own_df['Own'] > 90, 90, basic_own_df['Own']) | |
| # Apply the function to each dataframe | |
| basic_own_df = calculate_ownership(basic_own_df) | |
| own_norm_var_reg = 600 / basic_own_df['Own'].sum() | |
| own_norm_var_small = 600 / basic_own_df['Small Field Own%'].sum() | |
| own_norm_var_large = 600 / basic_own_df['Large Field Own%'].sum() | |
| own_norm_var_cash = 600 / basic_own_df['Cash Own%'].sum() | |
| basic_own_df['Own'] = basic_own_df['Own'] * own_norm_var_reg | |
| basic_own_df['Small_Own'] = basic_own_df['Small Field Own%'] * own_norm_var_small | |
| basic_own_df['Large_Own'] = basic_own_df['Large Field Own%'] * own_norm_var_large | |
| basic_own_df['Cash_Own'] = basic_own_df['Cash Own%'] * own_norm_var_cash | |
| own_dict = dict(zip(basic_own_df.Player, basic_own_df.Own)) | |
| small_own_dict = dict(zip(basic_own_df.Player, basic_own_df['Small Field Own%'])) | |
| large_own_dict = dict(zip(basic_own_df.Player, basic_own_df['Large Field Own%'])) | |
| cash_own_dict = dict(zip(basic_own_df.Player, basic_own_df['Cash Own%'])) | |
| ko_dict = dict(zip(basic_own_df.Player, basic_own_df.KO_odds)) | |
| sub_dict = dict(zip(basic_own_df.Player, basic_own_df.Sub_odds)) | |
| flex_file = basic_own_df[['Player', 'Salary', 'Median', 'KO_odds', 'Sub_odds', 'range_var']] | |
| flex_file = flex_file.rename(columns={"Agg": "Median"}) | |
| flex_file['Median'] = flex_file['Median'] - (flex_file['Median'] * (flex_file['range_var']-.5)) | |
| flex_file['Floor'] = flex_file['Median'] * (1-flex_file['range_var']) | |
| flex_file['Ceiling'] = flex_file['Median'] * (1+flex_file['range_var']) | |
| flex_file['STD'] = (flex_file['Median'] / std_var) | |
| flex_file = flex_file[['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'STD']] | |
| flex_file = flex_file.reset_index(drop=True) | |
| hold_file = flex_file.copy() | |
| overall_file = flex_file.copy() | |
| salary_file = flex_file.copy() | |
| try: | |
| overall_floor_gpu = np_array(overall_file['Floor']) | |
| overall_ceiling_gpu = np_array(overall_file['Ceiling']) | |
| overall_median_gpu = np_array(overall_file['Median']) | |
| overall_std_gpu = np_array(overall_file['STD']) | |
| overall_salary_gpu = np_array(overall_file['Salary']) | |
| data_shape = (len(overall_file['Player']), total_sims) # Example: 1000 rows | |
| salary_array = np_zeros(data_shape) | |
| sim_array = np_zeros(data_shape) | |
| for x in range(0, total_sims): | |
| result_gpu = overall_salary_gpu | |
| salary_array[:, x] = result_gpu | |
| cupy_array = salary_array | |
| salary_file = salary_file.reset_index(drop=True) | |
| salary_cupy = DataFrame(cupy_array, columns=list(range(0, total_sims))) | |
| salary_check_file = pd_concat([salary_file, salary_cupy], axis=1) | |
| except: | |
| for x in range(0,total_sims): | |
| salary_file[x] = salary_file['Salary'] | |
| salary_check_file = salary_file.copy() | |
| salary_file=salary_check_file.drop(['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1) | |
| salary_file = salary_file.div(1000) | |
| try: | |
| for x in range(0, total_sims): | |
| if distribution_type == 'normal': | |
| # Normal distribution (existing logic) | |
| result_gpu = np_random.normal(overall_median_gpu, overall_std_gpu) | |
| elif distribution_type == 'poisson': | |
| # Poisson distribution - using median as lambda | |
| result_gpu = np_random.poisson(overall_median_gpu) | |
| elif distribution_type == 'bimodal': | |
| # Bimodal distribution - mixture of two normal distributions | |
| # First peak centered at 80% of median, second at 120% of median | |
| if np_random.random() < 0.5: | |
| result_gpu = np_random.normal(overall_floor_gpu, overall_std_gpu) | |
| else: | |
| result_gpu = np_random.normal(overall_ceiling_gpu, overall_std_gpu) | |
| else: | |
| raise ValueError("Invalid distribution type. Must be 'normal', 'poisson', or 'bimodal'") | |
| sim_array[:, x] = result_gpu | |
| add_array = sim_array | |
| overall_file = overall_file.reset_index(drop=True) | |
| df2 = DataFrame(add_array, columns=list(range(0, total_sims))) | |
| check_file = pd_concat([overall_file, df2], axis=1) | |
| except: | |
| for x in range(0,total_sims): | |
| if distribution_type == 'normal': | |
| overall_file[x] = np_random.normal(overall_file['Median'], overall_file['STD']) | |
| elif distribution_type == 'poisson': | |
| overall_file[x] = np_random.poisson(overall_file['Median']) | |
| elif distribution_type == 'bimodal': | |
| # Bimodal distribution fallback | |
| if np_random.random() < 0.5: | |
| overall_file[x] = np_random.normal(overall_file['Floor'], overall_file['STD']) | |
| else: | |
| overall_file[x] = np_random.normal(overall_file['Ceiling'], overall_file['STD']) | |
| check_file = overall_file.copy() | |
| overall_file=check_file.drop(['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'STD'], axis=1) | |
| players_only = hold_file[['Player']] | |
| raw_lineups_file = players_only | |
| for x in range(0,total_sims): | |
| maps_dict = {'proj_map':dict(zip(hold_file.Player,overall_file[x]))} | |
| raw_lineups_file[x] = sum([raw_lineups_file['Player'].map(maps_dict['proj_map'])]) | |
| players_only[x] = raw_lineups_file[x].rank(ascending=False) | |
| players_only=players_only.drop(['Player'], axis=1) | |
| salary_10x_check = (overall_file - (salary_file*10)) | |
| salary_11x_check = (overall_file - (salary_file*11)) | |
| salary_12x_check = (overall_file - (salary_file*12)) | |
| gpp_check = (overall_file - ((salary_file*11)+10)) | |
| players_only['Average_Rank'] = players_only.mean(axis=1) | |
| players_only['Top_finish'] = players_only[players_only == 1].count(axis=1)/total_sims | |
| players_only['Top_5_finish'] = players_only[players_only <= 5].count(axis=1)/total_sims | |
| players_only['Top_10_finish'] = players_only[players_only <= 10].count(axis=1)/total_sims | |
| players_only['100+%'] = overall_file[overall_file >= 100].count(axis=1)/float(total_sims) | |
| players_only['10x%'] = salary_10x_check[salary_10x_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['11x%'] = salary_11x_check[salary_11x_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['12x%'] = salary_12x_check[salary_12x_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['GPP%'] = gpp_check[gpp_check >= 1].count(axis=1)/float(total_sims) | |
| players_only['Player'] = hold_file[['Player']] | |
| final_outcomes = players_only[['Player', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '100+%', '10x%', '11x%', '12x%', 'GPP%']] | |
| final_Proj = pd_merge(hold_file, final_outcomes, on="Player") | |
| final_Proj = final_Proj[['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '100+%', '10x%', '11x%', '12x%', 'GPP%']] | |
| final_Proj['Own'] = final_Proj['Player'].map(own_dict) | |
| final_Proj['Small_Own'] = final_Proj['Player'].map(small_own_dict) | |
| final_Proj['Large_Own'] = final_Proj['Player'].map(large_own_dict) | |
| final_Proj['Cash_Own'] = final_Proj['Player'].map(cash_own_dict) | |
| final_Proj = final_Proj[['Player', 'Salary', 'Floor', 'Median', 'Ceiling', 'Top_finish', 'Top_5_finish', 'Top_10_finish', '100+%', '10x%', '11x%', '12x%', 'GPP%', | |
| 'Own', 'Small_Own', 'Large_Own', 'Cash_Own']] | |
| final_Proj['Salary'] = final_Proj['Salary'].astype(int) | |
| final_Proj = final_Proj.sort_values(by='Median', ascending=False) | |
| return final_Proj.copy() |