Skip to content

Commit 0d3333f

Browse files
committed
Use MultiIndex.codes instead of labels (no longer support)
Please see these links for the rational if interested: pandas-dev/pandas#13443 pandas-dev/pandas#23752
1 parent ebb99f8 commit 0d3333f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

q2_diversity/tests/test_alpha_rarefaction.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def test_unique_metadata_groups(self):
421421
obs = _reindex_with_metadata('pet', ['pet'], data)
422422

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

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

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

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

0 commit comments

Comments
 (0)