def padr(x, n, val=0.):
    """Pad a matrix ``x`` on the right to length ``n`` with value ``val``.

    **Parameters:**

    x : ndarray
        The matrix to be padded.

    n : int
        The number of columns of the matrix after padding.

    val : scalar, optional
        The value to be used used for padding.

    .. note:: A 1-d array, for example ``a.shape == (N,)`` is reshaped to be
        a 1 row array: ``a.reshape((1, N))``

    The empty matrix is assumed to be have 1 empty row.

    **Returns:**

    xp : 2-d ndarray
        The padded matrix.
    """
    if len(x.shape) == 1:
        xp = x.reshape((1, x.shape[0]))
    else:
        xp = x
    y = np.concatenate(
                       (xp, 
                        val*np.ones((xp.shape[0], xp.shape[1] - n))
                       ), axis=1
                      )
    return y
dataset/ETHPy150Open ggventurini/python-deltasigma/deltasigma/_padr.py/padr/swapped operands of `-`