Partitions a dataset.

    For each row in the dataset, check if it matches the question. If
    so, add it to 'true rows', otherwise, add it to 'false rows'.

def split(X, Y, question):
    """Partitions a dataset.

    For each row in the dataset, check if it matches the question. If
    so, add it to 'true rows', otherwise, add it to 'false rows'.
    """

    true_X, false_X = [], []
    true_Y, false_Y = [], []

    for x, y in zip(X, Y):
        if question.match(x):
            true_X.append(x)
            true_Y.append(y)

        else:
            false_X.append(x)
            false_Y.append(y)

    return (np.array(true_X), np.array(false_X),
            np.array(true_Y), np.array(false_Y))