先把ticket中没有空格数据加上空格,然后再根据空格分割:
df[~df['ticket'].str.contains(" ")] = " " + df[~df['ticket'].str.contains(" ")]