f2cfa5fb8e73229a1757acbcc94bab13099de439,PyPi/utils/spaces.py,MultiDiscrete,get_idx,#MultiDiscrete#Any#,84

Before Change


    def get_idx(self, value):
        idx = list()
        for s, v in enumerate(value):
            idx.append(np.argwhere(
                self.discrete_spaces[s].values == v).ravel()[0])

        return idx

After Change


                self.discrete_spaces[i]._idxs[v] for i, v in enumerate(value)]
        elif value.ndim == 2:
            idxs = list()
            for v in value:
                idx = [
                    self.discrete_spaces[i]._idxs[v1] for i, v1 in enumerate(v)]
                idxs.append(idx)
        else:
            raise ValueError("Wrong dimension for indices array.")

        return np.array(idxs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: AIRLab-POLIMI/mushroom
Commit Name: f2cfa5fb8e73229a1757acbcc94bab13099de439
Time: 2017-06-05
Author: carlo.deramo@gmail.com
File Name: PyPi/utils/spaces.py
Class Name: MultiDiscrete
Method Name: get_idx


Project Name: biolab/orange3
Commit Name: 3721aada353b474d5b5ce726fa65de4968fb6b5e
Time: 2013-06-02
Author: jure.zbontar@gmail.com
File Name: Orange/classification/logistic.py
Class Name:
Method Name:


Project Name: scipy/scipy
Commit Name: bc889006b64e63457d81a496122463c57998f218
Time: 2015-01-17
Author: argriffi@ncsu.edu
File Name: scipy/sparse/linalg/dsolve/linsolve.py
Class Name:
Method Name: spsolve