Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -202,11 +202,9 @@ def get_correlated_portfolio_for_sim(Total_Sample_Size):
|
|
202 |
sizesplit = round(Total_Sample_Size * sharp_split)
|
203 |
|
204 |
RandomPortfolio, maps_dict, ranges_dict, full_pos_player_dict = create_random_portfolio(sizesplit, raw_baselines)
|
205 |
-
stack_num = random.randint(1,
|
206 |
stacking_dict = create_stack_options(raw_baselines, stack_num)
|
207 |
|
208 |
-
st.write(RandomPortfolio.head(100))
|
209 |
-
|
210 |
RandomPortfolio['QB'] = pd.Series(list(RandomPortfolio['QB'].map(qb_dict)), dtype="string[pyarrow]")
|
211 |
RandomPortfolio['RB1'] = pd.Series(list(RandomPortfolio['RB1'].map(full_pos_player_dict['pos_dicts'][0])), dtype="string[pyarrow]")
|
212 |
RandomPortfolio['WR1'] = pd.Series(list(RandomPortfolio['QB'].map(stacking_dict)), dtype="string[pyarrow]")
|
@@ -219,8 +217,6 @@ def get_correlated_portfolio_for_sim(Total_Sample_Size):
|
|
219 |
RandomPortfolio = RandomPortfolio[RandomPortfolio['plyr_count'] == 8].drop(columns=['plyr_list','plyr_count']).\
|
220 |
reset_index(drop=True)
|
221 |
|
222 |
-
st.write(RandomPortfolio.head(100))
|
223 |
-
|
224 |
del sizesplit
|
225 |
del full_pos_player_dict
|
226 |
del ranges_dict
|
@@ -259,6 +255,7 @@ def get_correlated_portfolio_for_sim(Total_Sample_Size):
|
|
259 |
RandomPortArray = np.c_[RandomPortArray, np.einsum('ij->i',RandomPortArray[:,26:35].astype(np.double))]
|
260 |
|
261 |
RandomPortArrayOut = np.delete(RandomPortArray, np.s_[8:35], axis=1)
|
|
|
262 |
RandomPortfolioDF = pd.DataFrame(RandomPortArrayOut, columns = ['QB', 'RB1', 'WR1', 'WR2', 'FLEX1', 'FLEX2', 'DST', 'User/Field', 'Salary', 'Projection', 'Own'])
|
263 |
RandomPortfolioDF = RandomPortfolioDF.sort_values(by=Sim_function, ascending=False)
|
264 |
del RandomPortArray
|
|
|
202 |
sizesplit = round(Total_Sample_Size * sharp_split)
|
203 |
|
204 |
RandomPortfolio, maps_dict, ranges_dict, full_pos_player_dict = create_random_portfolio(sizesplit, raw_baselines)
|
205 |
+
stack_num = random.randint(1, 3)
|
206 |
stacking_dict = create_stack_options(raw_baselines, stack_num)
|
207 |
|
|
|
|
|
208 |
RandomPortfolio['QB'] = pd.Series(list(RandomPortfolio['QB'].map(qb_dict)), dtype="string[pyarrow]")
|
209 |
RandomPortfolio['RB1'] = pd.Series(list(RandomPortfolio['RB1'].map(full_pos_player_dict['pos_dicts'][0])), dtype="string[pyarrow]")
|
210 |
RandomPortfolio['WR1'] = pd.Series(list(RandomPortfolio['QB'].map(stacking_dict)), dtype="string[pyarrow]")
|
|
|
217 |
RandomPortfolio = RandomPortfolio[RandomPortfolio['plyr_count'] == 8].drop(columns=['plyr_list','plyr_count']).\
|
218 |
reset_index(drop=True)
|
219 |
|
|
|
|
|
220 |
del sizesplit
|
221 |
del full_pos_player_dict
|
222 |
del ranges_dict
|
|
|
255 |
RandomPortArray = np.c_[RandomPortArray, np.einsum('ij->i',RandomPortArray[:,26:35].astype(np.double))]
|
256 |
|
257 |
RandomPortArrayOut = np.delete(RandomPortArray, np.s_[8:35], axis=1)
|
258 |
+
st.write(RandomPortArrayOut.head(100))
|
259 |
RandomPortfolioDF = pd.DataFrame(RandomPortArrayOut, columns = ['QB', 'RB1', 'WR1', 'WR2', 'FLEX1', 'FLEX2', 'DST', 'User/Field', 'Salary', 'Projection', 'Own'])
|
260 |
RandomPortfolioDF = RandomPortfolioDF.sort_values(by=Sim_function, ascending=False)
|
261 |
del RandomPortArray
|