-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
In the last lines of this script
for i in range(fc_players.shape[0]):
if(fc_players['r'][i] == 'P'):
if(fc_players['gk_games'][i] < min_gk_games):
for j in range(fc_players.shape[0]):
if(fc_players['team'][i] == fc_players['team'][j] and fc_players['gk_games'][j] >= min_gk_games):
break
weight = 1 - (min_gk_games - fc_players['gk_games'][i]) / min_gk_games
fc_players_newgk.at[i, columns_to_avg] = fc_players.loc[i][columns_to_avg] * weight + (1 - weight) * fc_players.loc[j][columns_to_avg]
print(fc_players['name'][i] + ', ' + str(weight))
I get the following error:
pandas.errors.InvalidIndexError: You can only assign a scalar value not a <class 'pandas.core.series.Series'> and I can’t move forward.
Can you help me?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels