luckiness
 1 import  pandas
 2 excel=pandas.read_excel(\'name.xlsx\')
 3 
 4 #这里的n是指保留前几列,默认为0或者1,意思是全部保留,expand指是否扩展,默认为False
 5 d=excel[\'name\'].str.split(n=0,expand=True)
 6 
 7 excel[\'first_name\']=d[0]
 8 excel[\'last_name\']=d[1]
 9 excel[\'first_name\']=excel[\'first_name\'].str.title()  #首字母大写
10 print(excel)

 

分类:

技术点:

相关文章:

  • 2021-10-07
  • 2021-12-09
  • 2021-12-29
  • 2021-08-14
  • 2021-12-01
  • 2021-12-08
  • 2021-10-01
猜你喜欢
  • 2021-11-19
  • 2021-12-14
  • 2021-10-07
  • 2021-12-08
  • 2021-09-01
相关资源
相似解决方案