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
Rename 'agents' property to 'df' for AgentContainer for issue # 68 (#148)
* moved agents to df
chnages done in AgentContainer to move agents to df and change done as rquied in agents/agentset in abstract/concrete.
Note: i have depreciated agents to use df instead to keep it compatible with others and will remove once all looks good
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* emoving agents property completely to use df property
removing agents property completely, instead use df property, also replacing agents with df in tests and boltzmann_wealth example
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* refactor: remove deprecated 'agents' property and its setter in AgentSetDF
* refactor: remove unnecessary blank line in AgentSetDF class
* refactor: rename 'agents' setter to 'df' in AgentContainer class
* refactor: update agentset property access from 'agents' to 'df' in AgentsDF class
* refactor: update agent access from 'agents' to 'df' in AntPolarsBase and subclasses
* refactor: update agent access from 'agents' to 'df' in AgentSetPolars class
* refactor: update model access from 'df' to 'agents' in fixture functions
* refactor: update agent access from 'agents' to 'df' in get_unique_ids function
* refactor: update agent access from '_agents' to '_df' across AgentSetDF, AgentsDF, and AgentSetPolars classes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* refactor: update agent access from 'agents' to 'df' in multiple classes and tests
* refactor: update agent access from 'agents' to 'df' in README and tutorial notebook
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Adam Amer <136176500+adamamer20@users.noreply.github.com>
You can access the underlying DataFrame where agents are stored with `self.agents`. This allows you to use DataFrame methods like `self.agents.sample` or `self.agents.group_by("wealth")` and more.
27
+
You can access the underlying DataFrame where agents are stored with `self.df`. This allows you to use DataFrame methods like `self.df.sample` or `self.df.group_by("wealth")` and more.
28
28
29
29
## ModelDF 🏗️
30
30
31
31
To add your AgentSetDF to your ModelDF, you should also add it to the agents with `+=` or `add`.
32
32
33
-
NOTE: ModelDF.agents are stored in a class which is entirely similar to AgentSetDF called AgentsDF. The API of the two are the same. If you try accessing AgentsDF.agents, you will get a dictionary of `[AgentSetDF, DataFrame]`.
33
+
NOTE: ModelDF.agents are stored in a class which is entirely similar to AgentSetDF called AgentsDF. The API of the two are the same. If you try accessing AgentsDF.df, you will get a dictionary of `[AgentSetDF, DataFrame]`.
0 commit comments