Closed rinanagashima closed 8 months ago
Unsure why it would fail on step 1 after working on step 0? This is simplified code b/c I've been having this issue for a while + could not figure out why.
I believe that for Tally
updaters if the name of the column doesn't match the name you give the updater you need to provide an alias equal to the updater name:
initial_partition = Partition(G, assignment=assign, updaters={"population": Tally("total",alias = "population"), "black population": Tally('blackpop',alias = "black population"), "hispanic population": Tally('hispanicpop',alias ="hispanic population" ), "asian population": Tally('asianpop',alias = "asian population"), "native american population": Tally('nativeamericanpop',alias = "native american population"), "native hawaiian population": Tally('nhpipop',alias = "native hawaiian population"), "multiracial population": Tally('multiracepop',alias = "multiracial population"), "white population": Tally('whitepop',alias='white population') })
Note that this probably doesn't matter for your actual use case but your toy example will crash pretty rapidly once one of the parts ends up with only one node.
Thank you so much for the quick response! This fixed the issue.
I keep getting KeyError: 'whitepop'.
Code:
Return