6b3c00cf4628865d1fb1698c97f2a1e54fcf9316,Orange/widgets/data/owmergedata.py,,join_table_by_indices,#Any#Any#Any#,337

Before Change


def join_table_by_indices(left, right, indices):
    if not indices:
        return None
    domain = Orange.data.Domain(
        left.domain.attributes + right.domain.attributes,
        left.domain.class_vars + right.domain.class_vars,
        left.domain.metas + right.domain.metas
    )
    X = join_array_by_indices(left.X, right.X, indices)
    Y = join_array_by_indices(np.c_[left.Y], np.c_[right.Y], indices)
    metas = join_array_by_indices(left.metas, right.metas, indices)
    for col, var in enumerate(domain.metas):
        if var.is_string:
            for row in range(metas.shape[0]):
                cell = metas[row, col]
                if isinstance(cell, float) and np.isnan(cell):
                    metas[row, col] = ""

    return Orange.data.Table.from_numpy(domain, X, Y, metas)


def join_array_by_indices(left, right, indices, masked=float("nan")):

After Change


            return None
        domain = Orange.data.Domain(
            *(getattr(self.data.domain, x) + getattr(reduced_extra.domain, x)
              for x in ("attributes", "class_vars", "metas")))
        X = self.join_array_by_indices(
            self.data.X, reduced_extra.X, indices)
        Y = self.join_array_by_indices(
            np.c_[self.data.Y], np.c_[reduced_extra.Y], indices)
        string_cols = [i for i, var in enumerate(domain.metas) if var.is_string]
        metas = self.join_array_by_indices(
            self.data.metas, reduced_extra.metas, indices, string_cols)
        return Orange.data.Table.from_numpy(domain, X, Y, metas)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: biolab/orange3
Commit Name: 6b3c00cf4628865d1fb1698c97f2a1e54fcf9316
Time: 2017-03-10
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/data/owmergedata.py
Class Name:
Method Name: join_table_by_indices


Project Name: biolab/orange3
Commit Name: a37921eef9c5c67fc43c6c81d42616bda10b3cde
Time: 2016-04-22
Author: andrej.jugovic7@gmail.com
File Name: Orange/tests/test_domain.py
Class Name: TestDomainInit
Method Name: test_domain_conversion_is_fast_enough


Project Name: biolab/orange3
Commit Name: 893b7c85c0cb072dfb59cbc1cca81a4a923d9df8
Time: 2015-12-18
Author: tomaz.hocevar@fri.uni-lj.si
File Name: Orange/tests/test_softmax_regression.py
Class Name: SoftmaxRegressionTest
Method Name: test_SoftmaxRegressionPreprocessors