def unravel_arrays(metric_array):

    dim = metric_array.shape[0]
    flat_array = []

    for indx in itertools.combinations(range(0, dim), r=2):
        if indx[0] != indx[1]:
            flat_array.append(metric_array[indx[1], indx[0]])
        else:
            pass
    return flat_array
Unravel a numpy array such that only one half of the symmetrical
dataset/ETHPy150Open CGATOxford/cgat/CGAT/Timeseries/__init__.py/unravel_arrays