if field in row_df else None code example Example: if list is null python apply any function site:stackoverflow.com >>> any([]), all([]) (False, True)