Skip to content

Instantly share code, notes, and snippets.

@terryjbates
Created January 19, 2025 11:05

Revisions

  1. terryjbates created this gist Jan 19, 2025.
    45 changes: 45 additions & 0 deletions exclude_cols.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    # 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