5a7514ccb18a3a506d453dd048c665c33835ee56,pandas/tests/indexes/categorical/test_indexing.py,TestGetIndexer,test_get_indexer_non_unique,#TestGetIndexer#,207

Before Change


            idx.get_indexer(idx, method="invalid")

    def test_get_indexer_non_unique(self):
        np.random.seed(123456789)

        ci = CategoricalIndex(list("aabbca"), categories=list("cab"), ordered=False)
        oidx = Index(np.array(ci))

        for n in [1, 2, 5, len(ci)]:
            finder = oidx[np.random.randint(0, len(ci), size=n)]
            expected = oidx.get_indexer_non_unique(finder)[0]

            actual = ci.get_indexer(finder)
            tm.assert_numpy_array_equal(expected, actual)

After Change



        for indexer in [idx2, list("abf"), Index(list("abf"))]:
            msg = "Reindexing only valid with uniquely valued Index objects"
            with pytest.raises(InvalidIndexError, match=msg):
                idx1.get_indexer(idx2)

            r1, _ = idx1.get_indexer_non_unique(idx2)
            expected = np.array([0, 1, 2, -1], dtype=np.intp)
            tm.assert_almost_equal(r1, expected)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pandas-dev/pandas
Commit Name: 5a7514ccb18a3a506d453dd048c665c33835ee56
Time: 2020-12-11
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/categorical/test_indexing.py
Class Name: TestGetIndexer
Method Name: test_get_indexer_non_unique


Project Name: deepchem/deepchem
Commit Name: 303e3983b998ec2037a21f59aac932dddd834e75
Time: 2020-08-13
Author: bharath@Bharaths-MBP.zyxel.com
File Name: deepchem/data/tests/test_legacy.py
Class Name:
Method Name: test_reshard


Project Name: pandas-dev/pandas
Commit Name: 5a7514ccb18a3a506d453dd048c665c33835ee56
Time: 2020-12-11
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/categorical/test_indexing.py
Class Name: TestGetIndexer
Method Name: test_get_indexer_non_unique


Project Name: probcomp/bayeslite
Commit Name: 651346e6d36fcd7c3bece2187aea9dfd498136cf
Time: 2016-07-21
Author: fsaad@mit.edu
File Name: tests/test_cgpm.py
Class Name:
Method Name: test_bad_analyze_vars