e7fbf0f7dbe36bcf9d0057f881b5faf7547e9a02,scipy/sparse/dok.py,dok_matrix,tocoo,#dok_matrix#Any#,471

Before Change



        idx_dtype = get_index_dtype(maxval=max(self.shape))
        data = np.asarray(_list(self.values()), dtype=self.dtype)
        indices = np.asarray(_list(self.keys()), dtype=idx_dtype).T
        A = coo_matrix((data, indices), shape=self.shape, dtype=self.dtype)
        A.has_canonical_format = True
        return A

After Change



        idx_dtype = get_index_dtype(maxval=max(self.shape))
        data = np.fromiter(itervalues(self), dtype=self.dtype, count=self.nnz)
        I = np.fromiter((i for i,_ in iterkeys(self)), dtype=idx_dtype, count=self.nnz)
        J = np.fromiter((j for _,j in iterkeys(self)), dtype=idx_dtype, count=self.nnz)
        A = coo_matrix((data, (I, J)), shape=self.shape, dtype=self.dtype)
        A.has_canonical_format = True
        return A
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: scipy/scipy
Commit Name: e7fbf0f7dbe36bcf9d0057f881b5faf7547e9a02
Time: 2017-01-07
Author: yoch.melka@gmail.com
File Name: scipy/sparse/dok.py
Class Name: dok_matrix
Method Name: tocoo


Project Name: scipy/scipy
Commit Name: 5ce91f1cc0d3dcdb8b53c47990774173b82eff62
Time: 2017-08-12
Author: akstrfn@gmail.com
File Name: scipy/sparse/dok.py
Class Name: dok_matrix
Method Name: __neg__


Project Name: scipy/scipy
Commit Name: 5ce91f1cc0d3dcdb8b53c47990774173b82eff62
Time: 2017-08-12
Author: akstrfn@gmail.com
File Name: scipy/sparse/dok.py
Class Name: dok_matrix
Method Name: __add__