Skip to content

Commit

Permalink
Merge pull request #179 from moritz-kirmse-forcity/20161110_fix_tests…
Browse files Browse the repository at this point in the history
…_pandas_deprecated_diff

updated deprecated `diff` function from pandas.Index
  • Loading branch information
janowicz authored Nov 14, 2016
2 parents c68d390 + a51afe4 commit caa6ab8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'matplotlib>=1.3.1',
'numpy>=1.8.0',
'orca>=1.1',
'pandas>=0.13.1',
'pandas>=0.15.0',
'patsy>=0.2.1',
'prettytable>=0.7.2',
'pyyaml>=3.10',
Expand Down
2 changes: 1 addition & 1 deletion urbansim/models/transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def remove_rows(data, nrows, accounting_column=None):
remove_index = remove_rows.index

logger.debug('finish: removed {} rows in transition model'.format(nrows))
return data.loc[data.index.diff(remove_index)], remove_index
return data.loc[data.index.difference(remove_index)], remove_index


def add_or_remove_rows(data, nrows, starting_index=None, accounting_column=None):
Expand Down
4 changes: 2 additions & 2 deletions urbansim/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def assert_index_equal(left, right):
"""
assert isinstance(left, pd.Index)
assert isinstance(right, pd.Index)
left_diff = left.diff(right)
right_diff = right.diff(left)
left_diff = left.difference(right)
right_diff = right.difference(left)
if len(left_diff) > 0 or len(right_diff) > 0:
raise AssertionError("keys not in left [{0}], keys not in right [{1}]".format(
left_diff, right_diff))

0 comments on commit caa6ab8

Please sign in to comment.