-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDraftClassPositionEdits.py
More file actions
211 lines (182 loc) · 8.03 KB
/
DraftClassPositionEdits.py
File metadata and controls
211 lines (182 loc) · 8.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# Imports
import pandas as pd
# Your File Path
file_path = 'Files/Madden26/IE/Season0/Player.xlsx'
df = pd.read_excel(file_path)
def update_position_ratings(row):
# Check the player's position and apply changes to specific columns
contract_status = row['ContractStatus']
if contract_status in ['Draft']:
# Change Edited Position Here
#row['AgilityRating'] -= 1
#row['AccelerationRating'] -= 1
if row['Position'] in ['QB'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['ThrowAccuracyDeepRating'] -= 1
row['ThrowAccuracyMidRating'] -= 1
row['ThrowAccuracyShortRating'] -= 1
row['ThrowPowerRating'] -= 1
row['ThrowOnTheRunRating'] -= 1
row['ThrowUnderPressureRating'] -= 1
row['BreakSackRating'] -= 1
if row['Position'] in ['HB'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 2
row['CarryingRating'] -= 3 ###Carrying for Base 26 Roster is really high###
row['BCVisionRating'] -= 2
row['BreakTackleRating'] -= 2
row['ShortRouteRunningRating'] -= 2
row['StiffArmRating'] -= 2
row['TruckingRating'] -= 2
row['CatchingRating'] -= 2
row['PassBlockRating'] -= 2
if row['Position'] in ['WR'] and row['OverallRating'] < 70:
row['AwarenessRating'] -= 2
row['CatchingRating'] -= 1
row['DeepRouteRunningRating'] -= 1
row['MediumRouteRunningRating'] -= 1
row['ShortRouteRunningRating'] -= 1
row['ReleaseRating'] -= 1
row['CatchInTrafficRating'] -= 1
row['SpectacularCatchRating'] -= 1
if row['Position'] in ['TE'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['CatchingRating'] -= 1
row['DeepRouteRunningRating'] -= 1
row['MediumRouteRunningRating'] -= 1
row['ShortRouteRunningRating'] -= 1
row['ReleaseRating'] -= 1
row['CatchInTrafficRating'] -= 1
row['SpectacularCatchRating'] -= 1
if row['Position'] in ['LT'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['ImpactBlockingRating'] -= 1
row['LeadBlockRating'] -= 1
row['RunBlockFinesseRating'] -= 1
row['RunBlockPowerRating'] -= 1
row['RunBlockRating'] -= 1
row['PassBlockRating'] -= 1
row['PassBlockFinesseRating'] -= 1
row['PassBlockPowerRating'] -= 1
if row['Position'] in ['LG'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['ImpactBlockingRating'] -= 1
row['LeadBlockRating'] -= 1
row['RunBlockFinesseRating'] -= 1
row['RunBlockPowerRating'] -= 1
row['RunBlockRating'] -= 1
row['PassBlockRating'] -= 1
row['PassBlockFinesseRating'] -= 1
row['PassBlockPowerRating'] -= 1
if row['Position'] in ['C'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['ImpactBlockingRating'] -= 1
row['LeadBlockRating'] -= 1
row['RunBlockFinesseRating'] -= 1
row['RunBlockPowerRating'] -= 1
row['RunBlockRating'] -= 1
row['PassBlockRating'] -= 1
row['PassBlockFinesseRating'] -= 1
row['PassBlockPowerRating'] -= 1
if row['Position'] in ['RG'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['ImpactBlockingRating'] -= 1
row['LeadBlockRating'] -= 1
row['RunBlockFinesseRating'] -= 1
row['RunBlockPowerRating'] -= 1
row['RunBlockRating'] -= 1
row['PassBlockRating'] -= 1
row['PassBlockFinesseRating'] -= 1
row['PassBlockPowerRating'] -= 1
if row['Position'] in ['RT'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['ImpactBlockingRating'] -= 1
row['LeadBlockRating'] -= 1
row['RunBlockFinesseRating'] -= 1
row['RunBlockPowerRating'] -= 1
row['RunBlockRating'] -= 1
row['PassBlockRating'] -= 1
row['PassBlockFinesseRating'] -= 1
row['PassBlockPowerRating'] -= 1
if row['Position'] in ['LE'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 3
row['BlockSheddingRating'] -= 2
row['FinesseMovesRating'] -= 2
row['PursuitRating'] -= 2
row['TackleRating'] -= 2
row['PlayRecognitionRating'] -= 2
row['PowerMovesRating'] -= 2
if row['Position'] in ['RE'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['BlockSheddingRating'] -= 1
row['FinesseMovesRating'] -= 2
row['PursuitRating'] -= 1
row['TackleRating'] -= 1
row['PlayRecognitionRating'] -= 1
row['PowerMovesRating'] -= 2
if row['Position'] in ['DT'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['BlockSheddingRating'] -= 1
row['FinesseMovesRating'] -= 1
row['PursuitRating'] -= 1
row['TackleRating'] -= 1
row['PlayRecognitionRating'] -= 1
row['PowerMovesRating'] -= 1
if row['Position'] in ['LOLB'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['PursuitRating'] -= 1
row['TackleRating'] -= 1
row['PlayRecognitionRating'] -= 1
row['ManCoverageRating'] -= 1
row['ZoneCoverageRating'] -= 1
row['BlockSheddingRating'] -= 1
if row['Position'] in ['ROLB'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['PursuitRating'] -= 1
row['TackleRating'] -= 1
row['PlayRecognitionRating'] -= 1
row['ManCoverageRating'] -= 1
row['ZoneCoverageRating'] -= 1
row['BlockSheddingRating'] -= 1
if row['Position'] in ['MLB'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['PursuitRating'] -= 1
row['TackleRating'] -= 1
row['PlayRecognitionRating'] -= 1
row['ManCoverageRating'] -= 1
row['ZoneCoverageRating'] -= 1
row['BlockSheddingRating'] -= 1
if row['Position'] in ['CB'] and row['OverallRating'] < 68:
row['AwarenessRating'] -= 2
row['PursuitRating'] -= 1
row['TackleRating'] -= 1
row['PlayRecognitionRating'] -= 1
row['ManCoverageRating'] -= 1
row['PressRating'] -= 1
row['ZoneCoverageRating'] -= 1
if row['Position'] in ['FS', 'SS'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 1
row['PursuitRating'] -= 1
row['TackleRating'] -= 1
row['PlayRecognitionRating'] -= 1
row['ManCoverageRating'] -= 1
row['PressRating'] -= 1
row['ZoneCoverageRating'] -= 1
if row['Position'] in ['K', 'P'] and row['OverallRating'] < 0:
row['AwarenessRating'] -= 0
row['KickPowerRating'] -= 0
row['KickAccuracyRating'] -= 0
# Add more conditions and changes for other columns and positions as needed
return row
# Track the original DataFrame before applying updates
original_df = df.copy()
# Apply the new function to update the DataFrame
df = df.apply(update_position_ratings, axis=1)
columns_to_remove = []
for column in df.columns:
# Check if the column values are equal, considering data type differences
if df[column].equals(original_df[column]):
columns_to_remove.append(column)
# Drop columns with no edits
df.drop(columns=columns_to_remove, inplace=True)
output_filename = 'DraftClassPositionEdits.xlsx'
df.to_excel('Files/Madden26/IE/Season0/DraftClassPositionEdits.xlsx', index=False)