We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f71b07 commit d2483b9Copy full SHA for d2483b9
mesa_frames/concrete/pandas/agentset.py
@@ -137,8 +137,7 @@ def add( # noqa : D102
137
"Length of data must match the number of columns in the AgentSet if being added as a Collection."
138
)
139
if len(agents) == len(obj._agents.columns):
140
- # we suppose the first element of the list is unique_id
141
- agents[0] = next(self._ids[self.model])
+ agents = next(self._ids[self.model]) + agents[1:]
142
columns = pd.Index(["unique_id"]).append(obj._agents.columns.copy())
143
new_agents = pd.DataFrame([agents], columns=columns).set_index(
144
"unique_id", drop=True
0 commit comments