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

Define empty or uninitialized columns in Julia IndexedTables ndsparse #289

Open
dmikushin opened this issue Nov 1, 2021 · 0 comments
Open

Comments

@dmikushin
Copy link

Hello, I'm cross-posting this from SO, in hope to get an answer.

I'm defining NDSparse table, with two columns "state" and "action" that shall be filled later. How should I specify these columns upon initialization?

using Pkg
Pkg.add("IndexedTables")
using IndexedTables

start_period = 1        # numer of first period to consider
num_agents = 100        # number of individuals to simulate

periods = [start_period, start_period + 3]

# https://github.com/JuliaData/IndexedTables.jl
df = ndsparse((Identifier = [1, num_agents], Period = periods), (state = [???], action = [???]))
print(df)

Furthermore, while "action" is an integer, "state" is supposed to be an integer array of a variable length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant