from functools import reduce
same_items = reduce(and_, (c.getItem(i) == an_array[i] for i in range(len(
    an_array))))
return and_(same_size, same_items)
Filter by whether column value equals a list in spark