I am trying to use:
ball_inf = ball_inf[['x','y','z', 'speed', 'Ball_Ownership', 'Ball_InPlay']] = ball_inf['base'].str.split('-',expand=True)
to spilt a dataframe with one column called 'base' which contains comma separated strings of varying lengths either 6 or 7, i.e.
"28,-7,0,82.00,A,Dead"
"38,-5,0,83.00,A,Dead,Go"
I get the warning:
Columns must be same length as key
Is there anyway of adding a NA if there is not a 7th item?