You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR deleted members mess up the matrix math so your dominance matrix and thus power rankings won't be correct
My league has been ongoing since 2016. Since then we've had to delete two members, but in ESPN they still retain that team id (6 and 8 in my case). When the code goes to develop the win matrices for the power rankings, it loops through the teams_sorted array: "for team in teams_sorted:"
The teams_sorted array correctly ignores the deleted teams. However, the win matrix is built upon opponent.team_id, so the team_id for 6 and 8 (array position 5 and 7) still exists. That outputs a matrix with rows != columns (rows follow teams_sorted list, columns follow opponent.team_id). Then, the matrix math uses len(X) where X is the win_matrix for its loops. len(X) gives you the number of rows in the matrix (since a matrix in python is really just a list of list). In my case, this meant that any wins against the two newer teams were ignored because there were 12 rows but 14 columns and the last 2 columns were the 2 newer members.
Sorry for the wall of text, but I was trying to step through to make it clear. I'll see if I can get a PR in but if someone else gets to this before me it's all theirs
The text was updated successfully, but these errors were encountered:
TL;DR deleted members mess up the matrix math so your dominance matrix and thus power rankings won't be correct
My league has been ongoing since 2016. Since then we've had to delete two members, but in ESPN they still retain that team id (6 and 8 in my case). When the code goes to develop the win matrices for the power rankings, it loops through the teams_sorted array: "for team in teams_sorted:"
The teams_sorted array correctly ignores the deleted teams. However, the win matrix is built upon opponent.team_id, so the team_id for 6 and 8 (array position 5 and 7) still exists. That outputs a matrix with rows != columns (rows follow teams_sorted list, columns follow opponent.team_id). Then, the matrix math uses len(X) where X is the win_matrix for its loops. len(X) gives you the number of rows in the matrix (since a matrix in python is really just a list of list). In my case, this meant that any wins against the two newer teams were ignored because there were 12 rows but 14 columns and the last 2 columns were the 2 newer members.
Sorry for the wall of text, but I was trying to step through to make it clear. I'll see if I can get a PR in but if someone else gets to this before me it's all theirs
The text was updated successfully, but these errors were encountered: