from warnings import warn


def reshape_data(data, shape):
    """
    Reshape data or return 1D data after warning.
    """
    try:
        return data.reshape(shape)
    except ValueError:
        warn(str(data.shape) + "cannot be shaped into" + str(shape))
        return data