import pandas as pd if __name__ == '__main__': employees = pd.read_excel("C:/Users/18124/Desktop/pandas/018_一列数据分割两列/Employees.xlsx") print(employees) # 分割列 df = employees["Full Name"].str.split(expand=True) print(df) # 添加列 employees["First Name"] = df[0] # 分割第一个列 employees["Last Name"] = df[1] # 分割第二个列 employees["Len Last Name"] = df[1].str.len() # 字符个数统计 - 第二列 print(employees)