采用:
L = ['Thanks You', 'Its fine no problem', 'Are you sure']#create new df df = pd.Dataframe({'col':L})print (df) col0Thanks You1 Its fine no problem2 Are you sure
df = pd.Dataframe({'oldcol':[1,2,3]})#add column to existing df df['col'] = Lprint (df) oldcol col0 1Thanks You1 2 Its fine no problem2 3 Are you sure
谢谢DYZ:
#default column name 0df = pd.Dataframe(L)print (df) 00Thanks You1 Its fine no problem2 Are you sure
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)