Skip to content

Commit

Permalink
update sample rows
Browse files Browse the repository at this point in the history
  • Loading branch information
bridwell committed Nov 17, 2016
1 parent 0c429a0 commit 7858ea3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion urbansim/utils/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def get_probs(data, prob_column=None):
p = data[prob_column].fillna(0).values
if p.sum() == 0:
p = np.ones(len(p))
if round(p.sum(), 0) != 1:
if abs(p.sum() - 1.0) > 1e-8:
p = p / (1.0 * p.sum())
return p

Expand Down

0 comments on commit 7858ea3

Please sign in to comment.