From d1196a71327282023623c5c53ee291bc2edce217 Mon Sep 17 00:00:00 2001 From: Evan Bolyen Date: Thu, 10 Oct 2019 17:19:47 -0700 Subject: [PATCH] MAINT: update reindex_axis for pandas 0.25.1 --- gneiss/plot/tests/test_dendrogram.py | 14 +++++++------- gneiss/tests/test_util.py | 8 ++++---- gneiss/util.py | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gneiss/plot/tests/test_dendrogram.py b/gneiss/plot/tests/test_dendrogram.py index b6d9e32..e6f10ef 100644 --- a/gneiss/plot/tests/test_dendrogram.py +++ b/gneiss/plot/tests/test_dendrogram.py @@ -33,13 +33,13 @@ def test_cache_ntips(self): t._cache_ntips() - self.assertEquals(t.leafcount, 4) - self.assertEquals(t.children[0].leafcount, 2) - self.assertEquals(t.children[1].leafcount, 2) - self.assertEquals(t.children[0].children[0].leafcount, 1) - self.assertEquals(t.children[0].children[1].leafcount, 1) - self.assertEquals(t.children[1].children[0].leafcount, 1) - self.assertEquals(t.children[1].children[1].leafcount, 1) + self.assertEqual(t.leafcount, 4) + self.assertEqual(t.children[0].leafcount, 2) + self.assertEqual(t.children[1].leafcount, 2) + self.assertEqual(t.children[0].children[0].leafcount, 1) + self.assertEqual(t.children[0].children[1].leafcount, 1) + self.assertEqual(t.children[1].children[0].leafcount, 1) + self.assertEqual(t.children[1].children[1].leafcount, 1) class TestUnrootedDendrogram(unittest.TestCase): diff --git a/gneiss/tests/test_util.py b/gneiss/tests/test_util.py index e1b973e..9f6655f 100644 --- a/gneiss/tests/test_util.py +++ b/gneiss/tests/test_util.py @@ -335,13 +335,13 @@ def test_biom_match(self): exp_df = pd.DataFrame(exp_table.to_dataframe()) res_df = pd.DataFrame(res_table.to_dataframe()) - exp_df = exp_df.reindex_axis(sorted(exp_df.columns), axis=1) - res_df = res_df.reindex_axis(sorted(res_df.columns), axis=1) + exp_df = exp_df.reindex(sorted(exp_df.columns), axis=1) + res_df = res_df.reindex(sorted(res_df.columns), axis=1) pdt.assert_frame_equal(exp_df, res_df) - exp_md = exp_md.reindex_axis(sorted(exp_md.index), axis=0) - res_md = res_md.reindex_axis(sorted(res_md.index), axis=0) + exp_md = exp_md.reindex(sorted(exp_md.index), axis=0) + res_md = res_md.reindex(sorted(res_md.index), axis=0) pdt.assert_frame_equal(res_md, exp_md) diff --git a/gneiss/util.py b/gneiss/util.py index 020f5f8..165c6e4 100644 --- a/gneiss/util.py +++ b/gneiss/util.py @@ -242,7 +242,7 @@ def _dense_match_tips(table, tree): _tree.bifurcate() _tree.prune() sorted_features = [n.name for n in _tree.tips()] - _table = _table.reindex_axis(sorted_features, axis=1) + _table = _table.reindex(sorted_features, axis=1) return _table, _tree