使用python连接Excel中的特定列

时间:2018-12-06 00:04:07

标签: python pandas dataframe

df2 = pd.read_excel("Testingt2.xlsx");
print(df2);
df2.to_sql(
    name='t3', 
    con=engine,
    if_exists='append',`enter code here`
    index=False
)
print(df2);
df2['new_col'] = df2.apply(lambda x: '-'.join(x.dropna().astype(str).id.depth), axis=1);
print (df2);

如何将其用于特定列

df2['new_col'] = df2.apply(lambda x: '-'.join(x.dropna().astype(str).id.depth), axis=1);
print (df2); -----

0 个答案:

没有答案