def patch_lines ( x ) : for idx in range ( len ( x ) - 1 ) : x [ idx ] = np . vstack ( [ x [ idx ] , x [ idx + 1 ] [ 0 , : ] ] ) return x
how to add lines to 2d arrays python
Draw lines between groups
def patch_lines(x):
    """
    Draw lines between groups
    """
    for idx in range(len(x)-1):
        x[idx] = np.vstack([x[idx], x[idx+1][0,:]])
    return x