该
name系列的成为
index在数据帧的行:
In [99]: df = pd.Dataframe(np.random.randn(8, 4), columns=['A','B','C','D'])In [100]: s = df.xs(3)In [101]: s.name = 10In [102]: df.append(s)Out[102]: A B C D0 -2.083321 -0.153749 0.174436 1.0810561 -1.026692 1.495850 -0.025245 -0.1710462 0.072272 1.218376 1.433281 0.7478153 -0.940552 0.853073 -0.134842 -0.2771354 0.478302 -0.599752 -0.080577 0.4686185 2.609004 -1.679299 -1.593016 1.1722986 -0.201605 0.406925 1.983177 0.0120307 1.158530 -2.240124 0.851323 -0.24037810 -0.940552 0.853073 -0.134842 -0.277135
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)