View Single Post
Old 05-16-2025, 06:32 AM   #63
squirrel
Minors (Rookie Ball)
 
Join Date: Oct 2018
Posts: 31
Quote:
Originally Posted by trence View Post
Has anyone had an issue after many seasons of the tool working? I tried both V1 and V2 and they fail. I'm getting this error on V1. First season I've had issues with it suddenly crashing out. Wondering if somehow it's exporting bad CSVs all of a sudden
--------------------------------------------------------------------------------------------------

ValueError Traceback (most recent call last)
<ipython-input-220-1929e306d16c> in <cell line: 0>()
27
28 # Apply function to dataframe
---> 29 merged_df[['has_pos', 'field']] = merged_df.apply(determine_positions, axis=1)
30

2 frames
/usr/local/lib/python3.11/dist-packages/pandas/core/indexers/utils.py in check_key_length(columns, key, value)
388 if columns.is_unique:
389 if len(value.columns) != len(key):
--> 390 raise ValueError("Columns must be same length as key")
391 else:
392 # Missing keys in columns are represented as -1

ValueError: Columns must be same length as key


This is from the section

# calculated modified best position based on fielding ratings - i.e. whether a hitter 'has a position' or is just a 1b/dh
Hmm...tough one to help with there just going by that error message. Most simple place to start is to check that you've updated the ID of your scouting director to be the latest one.

This is on v1, right i.e. not the latest stuff I put out?
squirrel is offline   Reply With Quote