def split_data(data, ratio=0.7):
    """Splits data into test set and training set.

    :param data: The object containing data.
    :type data: :class:`pandas.DataFrame`.
    :param ratio: What portion of data to include in the training set
        and the test set. :obj:`0.5` means that the data will be
        distributed equaly.
    :type ratio: float
    """
    threshold = int(len(data) * ratio)
    return data[:threshold], data[threshold:]