我有一个简单的DataFrame:importpandasaspddf=pd.DataFrame({'id':list('abcd')})df['tuples']=df.index.map(lambdai:(i,i+1))#outputs:#idtuples#0a(0,1)#1b(1,2)#2c(2,3)#3d(3,4)然后我可以非常简单地将元组列分成两列,例如df[['x','y']]=pd.DataFrame(df.tuples.tolist())#outputs:#idtuplesxy#0a(0,1)01#1b(1,2)12#2c(2,3)23#3d(3,4)34这种方法也有效: