remove empty list element python pandas code example Example: python remove empty list list2 = filter(None, list1)