Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Apr 26, 2023

Added a check to prevent out of order pandas series from being concatenated improperly. If there is an index in the panda series then it is reindexed to match the final data frame, otherwise skip.

@dhensle
Copy link
Contributor

dhensle commented Feb 6, 2024

Context here is that the preprocessor runs all the python expressions and then concatenates them. If they are all pandas with the same index, they'll get joined together no problem. However, if for example it's an array that gets turned back into a pandas series but now has a different order, it'll be scrambled when you try to join them.

In other words, this PR helps prevent users from an incorrect merge when writing complicated preprocessor expressions.

@dhensle dhensle marked this pull request as ready for review February 6, 2024 22:16
@jpn--
Copy link
Member

jpn-- commented Feb 7, 2024

This PR seems like a great candidate for "show me in a unit test". Can we do that in a timely manner here?

@dhensle
Copy link
Contributor

dhensle commented Feb 8, 2024

Unit test added and passing. Ready for your review @jpn--.

@dhensle dhensle requested a review from jpn-- February 8, 2024 19:42
@jpn-- jpn-- merged commit bdc9cac into ActivitySim:develop Feb 9, 2024
@jpn-- jpn-- mentioned this pull request Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants