Update app.py
Browse files
app.py
CHANGED
@@ -673,15 +673,15 @@ with tab2:
|
|
673 |
|
674 |
# Set the factors based on the contest_var1
|
675 |
factor_qb, factor_other = {
|
676 |
-
'Small': (
|
677 |
-
'Medium': (
|
678 |
-
'Large': (
|
679 |
}[contest_var1]
|
680 |
|
681 |
# Apply the calculation to the DataFrame
|
682 |
initial_proj['Own%'] = initial_proj.apply(lambda row: calculate_own(row['Position'], row['Own'], initial_proj.loc[initial_proj['Position'] == row['Position'], 'Own'].mean(), factor_qb if row['Position'] == 'QB' else factor_other), axis=1)
|
683 |
initial_proj['Own%'] = initial_proj['Own%'].clip(upper=75)
|
684 |
-
initial_proj['Own'] = initial_proj['Own%'] * (
|
685 |
|
686 |
# Drop unnecessary columns and create the final DataFrame
|
687 |
Overall_Proj = initial_proj[['Player', 'Team', 'Position', 'Median', 'Own', 'Salary']]
|
@@ -698,15 +698,15 @@ with tab2:
|
|
698 |
|
699 |
# Set the factors based on the contest_var1
|
700 |
factor_qb, factor_other = {
|
701 |
-
'Small': (
|
702 |
-
'Medium': (
|
703 |
-
'Large': (
|
704 |
}[contest_var1]
|
705 |
|
706 |
# Apply the calculation to the DataFrame
|
707 |
initial_proj['Own%'] = initial_proj.apply(lambda row: calculate_own(row['Position'], row['Own'], initial_proj.loc[initial_proj['Position'] == row['Position'], 'Own'].mean(), factor_qb if row['Position'] == 'QB' else factor_other), axis=1)
|
708 |
initial_proj['Own%'] = initial_proj['Own%'].clip(upper=75)
|
709 |
-
initial_proj['Own'] = initial_proj['Own%'] * (
|
710 |
|
711 |
# Drop unnecessary columns and create the final DataFrame
|
712 |
Overall_Proj = initial_proj[['Player', 'Team', 'Position', 'Median', 'Own', 'Salary']]
|
|
|
673 |
|
674 |
# Set the factors based on the contest_var1
|
675 |
factor_qb, factor_other = {
|
676 |
+
'Small': (8, 10),
|
677 |
+
'Medium': (5, 5),
|
678 |
+
'Large': (1.5, 1.5),
|
679 |
}[contest_var1]
|
680 |
|
681 |
# Apply the calculation to the DataFrame
|
682 |
initial_proj['Own%'] = initial_proj.apply(lambda row: calculate_own(row['Position'], row['Own'], initial_proj.loc[initial_proj['Position'] == row['Position'], 'Own'].mean(), factor_qb if row['Position'] == 'QB' else factor_other), axis=1)
|
683 |
initial_proj['Own%'] = initial_proj['Own%'].clip(upper=75)
|
684 |
+
initial_proj['Own'] = initial_proj['Own%'] * (600 / initial_proj['Own%'].sum())
|
685 |
|
686 |
# Drop unnecessary columns and create the final DataFrame
|
687 |
Overall_Proj = initial_proj[['Player', 'Team', 'Position', 'Median', 'Own', 'Salary']]
|
|
|
698 |
|
699 |
# Set the factors based on the contest_var1
|
700 |
factor_qb, factor_other = {
|
701 |
+
'Small': (8, 10),
|
702 |
+
'Medium': (5, 5),
|
703 |
+
'Large': (1.5, 1.5),
|
704 |
}[contest_var1]
|
705 |
|
706 |
# Apply the calculation to the DataFrame
|
707 |
initial_proj['Own%'] = initial_proj.apply(lambda row: calculate_own(row['Position'], row['Own'], initial_proj.loc[initial_proj['Position'] == row['Position'], 'Own'].mean(), factor_qb if row['Position'] == 'QB' else factor_other), axis=1)
|
708 |
initial_proj['Own%'] = initial_proj['Own%'].clip(upper=75)
|
709 |
+
initial_proj['Own'] = initial_proj['Own%'] * (600 / initial_proj['Own%'].sum())
|
710 |
|
711 |
# Drop unnecessary columns and create the final DataFrame
|
712 |
Overall_Proj = initial_proj[['Player', 'Team', 'Position', 'Median', 'Own', 'Salary']]
|