Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
had error in runner: TypeError: 'dict_keyiterator' object cannot be interpreted as an integer [...] in numpy.random.mtrand.RandomState.choice ValueError: a must be 1-dimensional or an integer File "C:\Users\bigma\PycharmProjects\pycopancore\pycopancore\model_components\exploit_social_learning\implementation\culture.py", line 42, in social_update agent_j = np.random.choice(self.acquaintance_network.neighbors(agent_i)) with (self.acquaintance_network.neighbors(agent_i)) being <dict_keyiterator object at 0x00000226F0049F90> FIX: extracting list from key with list() agent_j = np.random.choice(list(self.acquaintance_network.neighbors(agent_i)))
- Loading branch information
1ffd331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right? After adjusting this the runner finished without errors, but I am not sure if by applying random.choice to a list instead of directly I changed something qualitatively.
Maybe someone can check and confirm? @mensch72 @jdonges @
1ffd331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more context:
-Trying to get exploit to run
-study script: run_exploit.py