Skip to content

Commit

Permalink
small fix in print statement in interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
fscottfoti committed May 28, 2014
1 parent fd2ba33 commit 063e8e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion urbansim/models/yamlmodelrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def hedonic_simulate(df, cfgname, outdf, outfname):
hm = RegressionModel.from_yaml(str_or_buffer=cfg)
price_or_rent = hm.predict(df)
print price_or_rent.describe()
outdf[outfname] = price_or_rent.reindex(outdf.index)
outdf.loc[price_or_rent.index.values, outfname] = price_or_rent


def lcm_estimate(choosers, chosen_fname, alternatives, cfgname):
Expand Down
5 changes: 4 additions & 1 deletion urbansim/urbanchoice/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def mnl_interaction_dataset(choosers, alternatives, SAMPLE_SIZE,
# something that isn't in the alternatives table
if chosenalts is not None:
isin = chosenalts.isin(alternatives.index)
removing = isin.value_counts()[False]
try:
removing = isin.value_counts().loc[False]
except:
removing = None
if removing:
print (
"Removing {} choice situations because chosen "
Expand Down

0 comments on commit 063e8e4

Please sign in to comment.