Reputation: 31
How to add multiple columns from one dataframe to another dataframe i laready figured out to add a single column but not getting multiple columns. I am a newbie
df
new['Symbol']= pd.Series(df['Symbol'])
dfnew['Symbol']['Desc']= pd.Series(df['Symbol']['Desc'])
Upvotes: 0
Views: 60
Reputation: 75150
Use:
dfnew['Symbol'],dfnew['Desc']= df['Symbol'],df['Desc']
Or df.assign()
:
dfnew=dfnew.assign(Symbol=df.Symbol,Desc=df.Desc)
If needed initialize dfnew
first as dfnew=pd.DataFrame()
Upvotes: 1