def unpad_array(a, axis=1):
    """Return `a` with row removed along `axis`.

    Parameters
    ----------
    a : ndarray
        Array from which to remove row
    axis : int, optional
        Axis from which to remove row

    Returns
    -------
    ndarray
        Unpadded array.
    """
    if a.ndim == 1:
        return a[:-1]
    else:
        shape = list(a.shape)
        shape[axis] -= 1
        return a[: shape[0], : shape[1]]