def split_labels(data, label_idx=-1):
    """
    Split labels from numerical data

    :param data: array of inputs data
    :type data: nd.array
    :param label_idx: index where label is located in the array. It can be only at start of at the end of the array
    :type label_idx: int
    :return: data without labels, labels
    :rtype: nd.array, nd.array
    """
    # return (Data, Labels)
    if label_idx == -1 or label_idx == data.shape[-1]:
        return data[..., :-1], data[..., -1]
    elif label_idx == 0:
        return data[..., 1:], data[..., 0]
    else:
        raise RuntimeError('Labels must be on axis 0 or 1')