def flatten_from_2d(list_of_lists):
    """
    Returns a 1d, flattened version of a 2d array or list of lists.
    This also removes any empty elements.
    """
    vec = []
    for row in iter(list_of_lists):
        vec.extend(row)
        
    return vec