1af61eee76fc63e98ba5ad85ad82fbd18111b8e9,scipy/sparse/data.py,_minmax_mixin,_min_or_max_axis,#_minmax_mixin#Any#Any#,106

Before Change


        data = out_mat.data[0]

        for i, (start, stop) in enumerate(izip(mat.indptr, mat.indptr[1:])):
            if start == stop:
                continue
            val = min_or_max(mat.data[start:stop])
            if stop - start < N:
                val = min_or_max([0, val])
            data.append(val)
            row.append(i)
        if axis == 1:
            out_mat = out_mat.tocsr().T

After Change


        mat = self.tocsc() if axis == 0 else self.tocsr()
        mat.sum_duplicates()

        indptr = mat.indptr
        zero = self.dtype.type(0)
        out = np.zeros(len(indptr) - 1, dtype=self.dtype)
        // can"t use indices > data length with reduceat`
        trunc = np.searchsorted(indptr, indptr[-1])
        min_or_max.reduceat(mat.data, indptr[:trunc], out=out[:trunc])
        nnz = np.diff(indptr)
        min_or_max(out, zero, where=nnz < N, out=out)
        out[nnz == 0] = zero
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: scipy/scipy
Commit Name: 1af61eee76fc63e98ba5ad85ad82fbd18111b8e9
Time: 2014-01-28
Author: joel.nothman@gmail.com
File Name: scipy/sparse/data.py
Class Name: _minmax_mixin
Method Name: _min_or_max_axis


Project Name: acoular/acoular
Commit Name: 97a346493ac31f120102d4cb3cf8586333d1a1ec
Time: 2010-09-16
Author: sarradj@tu-cottbus.de
File Name: beamfpy/beamfpy.py
Class Name:
Method Name: synthetic


Project Name: stellargraph/stellargraph
Commit Name: 19efebad71288796c490f7dfcc4092afee646611
Time: 2020-05-27
Author: kieranricardo@hotmail.com
File Name: stellargraph/data/explorer.py
Class Name:
Method Name: naive_weighted_choices