(self, l=0, with_replacement=False)
return t
Generates a shuffled version of the temporal network in which edge statistics (i.e.
        the frequencies of time-stamped edges) are preserved, while all order correlations are 
        destroyed. The shuffling procedure randomly reshuffles the time-stamps of links.
        
        @param l: the length of the sequence to be generated (i.e. the number of time-stamped links.
            For the default value l=0, the length of the generated shuffled temporal network will be 
            equal to that of the original temporal network. 
        @param with_replacement: Whether or not the sampling should be with replacement (default False)
Generates a shuffled version of the temporal network in which edge statistics (i.e.
        the frequencies of time-stamped edges) are preserved, while all order correlations are 
        destroyed. The shuffling procedure randomly reshuffles the time-stamps of links.
Generates a shuffled version of the temporal network in which edge statistics ( i . e . the frequencies of time - stamped edges ) are preserved while all order correlations are destroyed . The shuffling procedure randomly reshuffles the time - stamps of links .
def ShuffleEdges(self, l=0, with_replacement=False):        
        """
        Generates a shuffled version of the temporal network in which edge statistics (i.e.
        the frequencies of time-stamped edges) are preserved, while all order correlations are 
        destroyed. The shuffling procedure randomly reshuffles the time-stamps of links.
        
        @param l: the length of the sequence to be generated (i.e. the number of time-stamped links.
            For the default value l=0, the length of the generated shuffled temporal network will be 
            equal to that of the original temporal network. 
        @param with_replacement: Whether or not the sampling should be with replacement (default False)
        """

        tedges = []        
        
        timestamps = [e[2] for e in self.tedges]
        edges = list(self.tedges)
        
        if l==0:
            l = len(self.tedges)
        for i in range(l):
            
            if with_replacement:
            # Pick random link
                edge = edges[_np.random.randint(0, len(edges))]
                # Pick random time stamp
                time = timestamps[_np.random.randint(0, len(timestamps))]
            else:
                # Pick random link
                edge = edges.pop(_np.random.randint(0, len(edges)))
            # Pick random time stamp
                time = timestamps.pop(_np.random.randint(0, len(timestamps)))            
            
            # Generate new time-stamped link
            tedges.append( (edge[0], edge[1], time) )

        # Generate temporal network
        t = TemporalNetwork(tedges=tedges)

        # Fix node order to correspond to original network
        t.nodes = self.nodes
            
        return t
def ShuffleEdges ( self , l = 0 , with_replacement = False ) : tedges = [ ] timestamps = [ e [ 2 ] for e in self . tedges ] edges = list ( self . tedges ) if l == 0 : l = len ( self . tedges ) for i in range ( l ) : if with_replacement : # Pick random link edge = edges [ _np . random . randint ( 0 , len ( edges ) ) ] # Pick random time stamp time = timestamps [ _np . random . randint ( 0 , len ( timestamps ) ) ] else : # Pick random link edge = edges . pop ( _np . random . randint ( 0 , len ( edges ) ) ) # Pick random time stamp time = timestamps . pop ( _np . random . randint ( 0 , len ( timestamps ) ) ) # Generate new time-stamped link tedges . append ( ( edge [ 0 ] , edge [ 1 ] , time ) ) # Generate temporal network t = TemporalNetwork ( tedges = tedges ) # Fix node order to correspond to original network t . nodes = self . nodes return t