def set(data, c):
    """
    Set to a constant.

    Parameters
    ----------
    data : ndarray
        Array of NMR data.
    c : float or complex
        Constant to set data to.

    Returns
    -------
    ndata : ndarray
        Array of constants.

    Notes
    -----
    data is set in place, if original data is required make a copy before
    calling this function.

    """
    data[(...), :] = c
    return data
