Python 正在尝试按';拆分输出';

Python 正在尝试按';拆分输出';,python,pandas,object,split,Python,Pandas,Object,Split,我有一个输出对象。现在我想把我的输出和 用这些值创建一个df。 这是我使用的输出: Seriennummer 701085.0 ([1525.5804581812297, 255.9005481721001, 0.596... 701086.0 ([1193.0420594479258, 271.17468806239793, 0.65... 701087.0 ([1265.5151604213813, 217.26487934586433, 0.60... 701088.0

我有一个输出对象。现在我想把我的输出和 用这些值创建一个df。 这是我使用的输出:

Seriennummer
701085.0    ([1525.5804581812297, 255.9005481721001, 0.596...
701086.0    ([1193.0420594479258, 271.17468806239793, 0.65...
701087.0    ([1265.5151604213813, 217.26487934586433, 0.60...
701088.0    ([1535.8282855508626, 200.6196628705149, 0.548...
701089.0    ([1500.4964672930257, 247.8883736673866, 0.583...
701090.0    ([1203.6453723293514, 258.5749562983118, 0.638...
701091.0    ([1607.1851164005993, 209.82194423587782, 0.56...
701092.0    ([1711.7277933836879, 231.1560159770871, 0.567...
dtype: object
这就是我正在做的事情,也是我尝试分割输出的原因:

x=df.T.iloc[1]
y=df.T.iloc[2]

def logifunc(x,c,a,b):
    return c / (1 + (a) * np.exp(-b*(x)))

result = df.groupby('Seriennummer').apply(lambda grp:
    opt.curve_fit(logifunc, grp.mrwSmpVWi, grp.mrwSmpP, p0=[110, 400, -2]))

print(result)

for element in result:
    parts = element.split(',')
    print (parts)
它不起作用。我得到一个错误:

AttributeError: 'tuple' object has no attribute 'split'
@耶斯雷尔 它起作用了。现在它显示了很多我不需要的数据。你知道我怎样才能把我不需要的数据放在每一张纸上吗

Seriennummer    0   1   2
701085.0    1525.5804581812297  255.9005481721001   0.5969011082719918
701085.0    [ 9.41414894e+03 -2.07982124e+03 -2.30130078e+00]   [-2.07982124e+03  1.44373786e+03  9.59282709e-01]   [-2.30130078e+00  9.59282709e-01  7.75807643e-04]
701086.0    1193.0420594479258  271.17468806239793  0.6592054681687264
701086.0    [ 5.21906135e+03 -2.23855187e+03 -2.11896425e+00]   [-2.23855187e+03  2.61036500e+03  1.67396324e+00]   [-2.11896425e+00  1.67396324e+00  1.22581746e-03]
701087.0    1265.5151604213813  217.26487934586433  0.607183527397275
DataFrame
构造函数一起使用:

s = result.explode()
df1 = pd.DataFrame(s.tolist(), index=s.index)
如果小数据和/或性能不重要:

df1 = result.explode().apply(pd.Series)