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

Transition model, preserve index name? #221

Open
bridwell opened this issue Jan 23, 2020 · 2 comments
Open

Transition model, preserve index name? #221

bridwell opened this issue Jan 23, 2020 · 2 comments

Comments

@bridwell
Copy link
Contributor

When running transition model, the resulting data frame loses the index name (I'm guessing because of the concat). Is this worth preserving? This would be a simple fix, but not sure if it would break existing implementations.

@hanase
Copy link
Contributor

hanase commented Jan 27, 2020

We came across this too. Our transition model handles it by running these lines after the full_transition() (for HTM):

orca.get_table("persons").index.name = persons.index.name
orca.get_table("households").index.name = households.index.name

But this should be handled by the urbansim_defaults.utils.full_transition() function.

@smmaurer
Copy link
Member

Hi @bridwell, thanks for pointing this out. I agree that it should be fixed. It seems unlikely to break anything (and worth doing even if it did).

Is the concat you're referring to the one in transition.py#L468? I'm not sure exactly what's happening there, but it looks like the second DataFrame doesn't have a named index, which would as you say lead to the index name of the main table being dropped.

And probably fixing it at the source would fix urbansim_defaults too.

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