Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export history to pandas dataframe #837

Open
sbenthall opened this issue Sep 21, 2020 · 3 comments
Open

export history to pandas dataframe #837

sbenthall opened this issue Sep 21, 2020 · 3 comments

Comments

@sbenthall
Copy link
Contributor

After a simulation, the user can get the tracked variables through the agent.history property.

This history is a dictionary, where keys are tracked variables and values are a T x N array, where N is the number of agents (AgentCount) and T is the number of periods in the simulation.

I'd like to have the feature of easily exporting this into a Pandas DataFrame format.
It would help with some kinds of analysis.

Do this would require adding Pandas as a dependency.

@sbenthall sbenthall added this to the 1.0.0 milestone Sep 21, 2020
@sbenthall sbenthall modified the milestones: 1.0.0, 1.x.y Dec 10, 2020
@Mv77
Copy link
Contributor

Mv77 commented Jan 4, 2021

I was looking through issues and wanted to express support for this one.

One feature that I think is important would be to have a way to easily keep track of agent's "identities".

In the current framework, when an agent dies it is replaced with a new agent. When formatting histories as a DataFrame it would be very, very useful to keep track of these changes in "identity": a variable that would allow one to know that some observation is from the third individual in a dynasty and not the second.

This can currently be figured out by the user by looking at when t_age is reset. But it would be nice to have it done automatically.

@sbenthall
Copy link
Contributor Author

Great point.
I see this as related to #847 now.

@sbenthall
Copy link
Contributor Author

See if Dolo has this functionality already for reporting.

@sbenthall sbenthall self-assigned this May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants