(self, filename)
Save the distance matrix to a file in the file format described at
        :obj:`~Orange.misc.distmatrix.DistMatrix.from_file`.

        Args:
            filename: file name
Save the distance matrix to a file in the file format described at
        :obj:`~Orange.misc.distmatrix.DistMatrix.from_file`.
Save the distance matrix to a file in the file format described at : obj : ~Orange . misc . distmatrix . DistMatrix . from_file .
def save(self, filename):
        """
        Save the distance matrix to a file in the file format described at
        :obj:`~Orange.misc.distmatrix.DistMatrix.from_file`.

        Args:
            filename: file name
        """
        n = len(self)
        data = "{}\taxis={}".format(n, self.axis)
        row_labels = col_labels = None
        if self.has_col_labels():
            data += "\tcol_labels"
            col_labels = self.col_items
        if self.has_row_labels():
            data += "\trow_labels"
            row_labels = self.row_items
        symmetric = np.allclose(self, self.T)
        if not symmetric:
            data += "\tasymmetric"
        with open(filename, "wt") as fle:
            fle.write(data + "\n")
            if col_labels is not None:
                fle.write("\t".join(str(e.metas[0]) for e in col_labels) + "\n")
            for i, row in enumerate(self):
                if row_labels is not None:
                    fle.write(str(row_labels[i].metas[0]) + "\t")
                if symmetric:
                    fle.write("\t".join(map(str, row[:i + 1])) + "\n")
                else:
                    fle.write("\t".join(map(str, row)) + "\n")
def save ( self , filename ) : n = len ( self ) data = "{}\taxis={}" . format ( n , self . axis ) row_labels = col_labels = None if self . has_col_labels ( ) : data += "\tcol_labels" col_labels = self . col_items if self . has_row_labels ( ) : data += "\trow_labels" row_labels = self . row_items symmetric = np . allclose ( self , self . T ) if not symmetric : data += "\tasymmetric" with open ( filename , "wt" ) as fle : fle . write ( data + "\n" ) if col_labels is not None : fle . write ( "\t" . join ( str ( e . metas [ 0 ] ) for e in col_labels ) + "\n" ) for i , row in enumerate ( self ) : if row_labels is not None : fle . write ( str ( row_labels [ i ] . metas [ 0 ] ) + "\t" ) if symmetric : fle . write ( "\t" . join ( map ( str , row [ : i + 1 ] ) ) + "\n" ) else : fle . write ( "\t" . join ( map ( str , row ) ) + "\n" )