Created
January 19, 2025 11:05
-
-
Save terryjbates/4e3827ebbc3be0fc0e541e40bb5d9f15 to your computer and use it in GitHub Desktop.
Numeric column conversion for exported FM team data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create excluded columns | |
EXCLUDE_COLS = """Inf | |
Name | |
Apps | |
Best Pos | |
Best Role | |
Best Duty | |
Pros | |
Expires | |
Distance | |
Dist/90 | |
Cons | |
Position | |
Club | |
On Loan From | |
Based | |
Asking Price | |
Salary | |
Nat | |
2nd Nat | |
Home Grown Status | |
Height | |
Weight | |
Preferred Foot | |
Personality | |
Media Handling | |
Shot % | |
Pas % | |
OP-Cr % | |
Conv % | |
Hdr % | |
xSv % | |
Sv % | |
Transfer Value | |
UID""".split("\n") | |
EXCLUDE_COLS | |
# Convert all the columns, barring exclusions to numeric | |
for col in scouting_data.columns: | |
if col not in EXCLUDE_COLS: | |
try: | |
# print(f"Processing {col}") | |
convert_to_numeric(scouting_data, scouting_data[col]) | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment