def destroy(self, timeseries, **args):
        percentage = args['percentage']
        min_length = args['min_length']
        max_length = args['max_length']

        lseries = timeseries.shape[0]
        marked = 0
        marked_intervals = []
        while(marked < int(floor((lseries * percentage)))):
            start = randint(0, lseries - 1)
            end = randint(start + min_length, start + max_length)
            while(end > lseries - 1):
                start = randint(0, lseries - 1)
                end = randint(start + min_length, start + max_length)
            marked += (end - start)
            marked_intervals.append((start, end))

        exceptions = [0, lseries - 1]

        # exclude indices
        if('exclude' in args.keys()):
            exceptions = exceptions + args['exclude']

        removed_indices = []
        index_old = 0
        while index_old < lseries:
            for interval in marked_intervals:
                (start, end) = interval
                if((start <= index_old <= end) and index_old not in exceptions):
                    removed_indices.append(index_old)
                    break
            index_old += 1

        new_amount = lseries - len(removed_indices)
        # allocate new numpy array
        new_mat = zeros((new_amount,), dtype=[('date', int32),\
                ('corrected_score', float32),\
                ('speed', float32)])

        index_old = 0
        index_new = 0
        while index_old < lseries:
            if(index_old in removed_indices):
                index_old += 1
            else:
                new_mat[index_new] = timeseries[index_old]
                index_old += 1
                index_new += 1

        return new_mat, removed_indices
dataset/ETHPy150Open cigroup-ol/windml/windml/preprocessing/nmar_destroyer.py/NMARDestroyer.destroy/original