这是
wide_to_long
pd.wide_to_long(df,['t','l'],i=['id1','id2'],j='drop').reset_index(level=[0,1])Out[52]: id1 id2 t ldrop 1 1 2 a b2 1 2 c d1 3 4 g h2 3 4 i j
欢迎分享,转载请注明来源:内存溢出
这是
wide_to_long
pd.wide_to_long(df,['t','l'],i=['id1','id2'],j='drop').reset_index(level=[0,1])Out[52]: id1 id2 t ldrop 1 1 2 a b2 1 2 c d1 3 4 g h2 3 4 i j
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)