def tocoo(self,copy=True):
major_dim,minor_dim = self._swap(self.shape)<EOL>data = self.data<EOL>minor_indices = self.indices<EOL>if copy:<EOL><INDENT>data = data.copy()<EOL>minor_indices = minor_indices.copy()<EOL><DEDENT>major_indices = np.empty(len(minor_indices), dtype=self.indices.dtype)<EOL>_sparsetools.expandptr(major_dim,self.indptr,major_indices)<EOL>row,col = self._swap((major_indices,minor_indices))<EOL>from .coo import coo_matrix<EOL>return coo_matrix((data,(row,col)), self.shape)<EOL>
Return a COOrdinate representation of this matrix

        When copy=False the index and data arrays are not copied.