Skip to content

Commit

Permalink
keep_max_form creates a copy df using MultiIndex and remove_unused_le…
Browse files Browse the repository at this point in the history
…vels() to get sliced data from feasibility table.
  • Loading branch information
apdjustino committed Oct 4, 2017
1 parent f8a6f82 commit bc84eb3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions urbansim/developer/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,8 @@ def keep_form_with_max_profit(self, forms=None):
f = self.feasibility

if forms is not None:
feas = pd.DataFrame(index=f.index,
columns=pd.MultiIndex.from_tuples(f[forms].columns.values))

for form in forms:
feas[form] = f[form].values

f = feas
f_index = f[forms].columns.remove_unused_levels()
f = pd.DataFrame(data=f[forms], columns=f_index)

if len(f) > 0:
mu = self._max_form(f, "max_profit")
Expand Down

0 comments on commit bc84eb3

Please sign in to comment.