def split_array(array, ratio=0.9):
    """
    Split an array according to a given ratio along the first axis. Useful to partition arrays into train/val
    :param array: The array to split
    :param ratio: The ratio to split with
    :return:
    """
    assert ratio > 0
    assert ratio < 1
    return (array[0:int(ratio*len(array))], array[int(ratio*len(array)):])