Closed mxndrwgrdnr closed 4 years ago
Thanks @mxndrwgrdnr! It will be great to finally have this. I completely agree with this approach, as we discussed in Slack.
Here are some things i added just now:
.from_df()
works more smoothly.from_df()
accordinglyIf this all looks good, go ahead and merge!
Looks great, Sam. Thanks for getting it across the finish line.
This is a feature we've wanted for a long time, the ability to create a MergedChoiceTable object from a dataframe. This gives the user the ability to create an mct using the standard choicemodels workflow, but to then extract it, manipulate it, add new terms, and cast it back to an object that can be used by urbansim_templates or choicemodels once again.
My goal was to make as few changes as possible to the core class structure, and as a result my solution is not the most elegant. It relies on the instantiation of two empty dataframes and a wrongly typed class attribute to satisfy what are currently required parameters of the MergedChoiceTable class. I'm open to suggestions if we think there's a better way to achieve the intended result.