skipping empty list and continuing with function
问题 Background import pandas as pd Names = [list(['Jon', 'Smith', 'jon', 'John']), list([]), list(['Bob', 'bobby', 'Bobs'])] df = pd.DataFrame({'Text' : ['Jon J Smith is Here and jon John from ', '', 'I like Bob and bobby and also Bobs diner '], 'P_ID': [1,2,3], 'P_Name' : Names }) #rearrange columns df = df[['Text', 'P_ID', 'P_Name']] df Text P_ID P_Name 0 Jon J Smith is Here and jon John from 1 [Jon, Smith, jon, John] 1 2 [] 2 I like Bob and bobby and also Bobs diner 3 [Bob, bobby, Bobs] Goal I