Skip to content

Commit

Permalink
Use MultiIndex.codes instead of labels (no longer support)
Browse files Browse the repository at this point in the history
Please see these links for the rational if interested:

pandas-dev/pandas#13443

pandas-dev/pandas#23752
  • Loading branch information
andrewsanchez committed Feb 12, 2020
1 parent ebb99f8 commit 0d3333f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions q2_diversity/tests/test_alpha_rarefaction.py
Expand Up @@ -421,7 +421,7 @@ def test_unique_metadata_groups(self):
obs = _reindex_with_metadata('pet', ['pet'], data)

exp_col = pd.MultiIndex(levels=[[1, 200, 'pet'], [1, 2, '']],
labels=[[0, 0, 1, 1], [0, 1, 0, 1]],
codes=[[0, 0, 1, 1], [0, 1, 0, 1]],
names=['depth', 'iter'])
exp_ind = pd.Index(['milo', 'peanut', 'russ'], name='pet')
exp = pd.DataFrame(data=[[5, 6, 7, 8], [9, 10, 11, 12], [1, 2, 3, 4]],
Expand All @@ -445,7 +445,7 @@ def test_some_duplicates_in_column(self):
obs = _reindex_with_metadata('pet', ['pet'], data)

exp_col = pd.MultiIndex(levels=[[1, 200, 'pet'], [1, 2, '']],
labels=[[0, 0, 1, 1], [0, 1, 0, 1]],
codes=[[0, 0, 1, 1], [0, 1, 0, 1]],
names=['depth', 'iter'])
exp_ind = pd.Index(['milo', 'russ'], name='pet')
exp = pd.DataFrame(data=[[5, 6, 7, 8], [5, 6, 7, 8]],
Expand All @@ -469,7 +469,7 @@ def test_all_identical(self):
obs = _reindex_with_metadata('pet', ['pet'], data)

exp_col = pd.MultiIndex(levels=[[1, 200, 'pet'], [1, 2, '']],
labels=[[0, 0, 1, 1], [0, 1, 0, 1]],
codes=[[0, 0, 1, 1], [0, 1, 0, 1]],
names=['depth', 'iter'])
exp_ind = pd.Index(['russ'], name='pet')
exp = pd.DataFrame(data=[[5, 6, 7, 8]],
Expand All @@ -495,7 +495,7 @@ def test_multiple_columns(self):
obs = _reindex_with_metadata('pet', ['pet', 'toy'], data)

exp_col = pd.MultiIndex(levels=[[1, 200, 'pet', 'toy'], [1, 2, '']],
labels=[[0, 0, 1, 1], [0, 1, 0, 1]],
codes=[[0, 0, 1, 1], [0, 1, 0, 1]],
names=['depth', 'iter'])
exp_ind = pd.Index(['milo', 'peanut', 'russ'], name='pet')
exp = pd.DataFrame(data=[[5, 6, 7, 8], [9, 10, 11, 12], [1, 2, 3, 4]],
Expand Down

0 comments on commit 0d3333f

Please sign in to comment.