(array, condition)
return array[condition], array[~condition]
Split an array in two parts based on a boolean mask array `condition`.
Split an array in two parts based on a boolean mask array `condition`.
Split an array in two parts based on a boolean mask array condition .
def split_on_condition(array, condition):
    """
    Split an array in two parts based on a boolean mask array `condition`.
    """
    return array[condition], array[~condition]
def split_on_condition ( array , condition ) : return array [ condition ] , array [ ~ condition ]