(filename=None, separator=',', weight = False, undirected=False, maxlines=_sys.maxsize, expandSubPaths=True)
return p
Reads data from a file containing multiple lines of *edges* of the
        form "v,w,frequency,X" (where frequency is optional and X are arbitrary additional columns). The default separating 
        character ',' can be changed. In order to calculate the statistics of paths of any length, 
        by default all subpaths of length 1 (i.e. single nodes) contained in an edge will be considered.
Reads data from a file containing multiple lines of *edges* of the
        form "v,w,frequency,X" (where frequency is optional and X are arbitrary additional columns). The default separating 
        character ',' can be changed. In order to calculate the statistics of paths of any length, 
        by default all subpaths of length 1 (i.e. single nodes) contained in an edge will be considered.
Reads data from a file containing multiple lines of * edges * of the form v w frequency X ( where frequency is optional and X are arbitrary additional columns ) . The default separating character can be changed . In order to calculate the statistics of paths of any length by default all subpaths of length 1 ( i . e . single nodes ) contained in an edge will be considered .
def readEdges(filename=None, separator=',', weight = False, undirected=False, maxlines=_sys.maxsize, expandSubPaths=True):
        """
        Reads data from a file containing multiple lines of *edges* of the
        form "v,w,frequency,X" (where frequency is optional and X are arbitrary additional columns). The default separating 
        character ',' can be changed. In order to calculate the statistics of paths of any length, 
        by default all subpaths of length 1 (i.e. single nodes) contained in an edge will be considered.
        """
        p = Paths()

        p.separator = separator

        with open(filename, 'r') as f:
            Log.add('Reading edge data ... ')
            line = f.readline()
            n = 1 
            while line and n <= maxlines:
                fields = line.rstrip().split(separator)
                assert len(fields) >= 2, 'Error: malformed line: ' + line

                path = (fields[0],fields[1])

                if weight:                    
                    frequency = int(fields[2])
                else:
                    frequency = 1
                p.paths[1][path] += (0,frequency)
                if undirected:
                    reverse_path = (fields[1],fields[0])
                    p.paths[1][reverse_path] += (0,frequency)
                line = f.readline()
                n += 1
        # end of with open()
        
        if expandSubPaths:
            p.expandSubPaths()
        Log.add('finished.')

        return p
def readEdges ( filename = None , separator = ',' , weight = False , undirected = False , maxlines = _sys . maxsize , expandSubPaths = True ) : p = Paths ( ) p . separator = separator with open ( filename , 'r' ) as f : Log . add ( 'Reading edge data ... ' ) line = f . readline ( ) n = 1 while line and n <= maxlines : fields = line . rstrip ( ) . split ( separator ) assert len ( fields ) >= 2 , 'Error: malformed line: ' + line path = ( fields [ 0 ] , fields [ 1 ] ) if weight : frequency = int ( fields [ 2 ] ) else : frequency = 1 p . paths [ 1 ] [ path ] += ( 0 , frequency ) if undirected : reverse_path = ( fields [ 1 ] , fields [ 0 ] ) p . paths [ 1 ] [ reverse_path ] += ( 0 , frequency ) line = f . readline ( ) n += 1 # end of with open() if expandSubPaths : p . expandSubPaths ( ) Log . add ( 'finished.' ) return p