xxxxxxxxxx
DataFrame["new_column"] = DataFrame["column1"] + DataFrame["column2"]
xxxxxxxxxx
df_outer = pd.merge(df1, df2, on='id', how='outer') #here id is common column
df_outer
xxxxxxxxxx
#suppose you have two dataframes df1 and df2, and
#you need to merge them along the column id
df_merge_col = pd.merge(df1, df2, on='id')
xxxxxxxxxx
import pandas as pd
T1 = pd.merge(T1, T2, on=T1.index, how='outer')
Merging of Two Datasets on the basis of their index number
xxxxxxxxxx
new_data = pd.merge(df1, df2, left_index=True, right_index=True)
new_data
xxxxxxxxxx
cols = ['foo', 'bar', 'new']
df['combined'] = df[cols].apply(lambda row: '_'.join(row.values.astype(str)), axis=1)
xxxxxxxxxx
df["station"] = df["End station"].combine_first(df["Start station"])
df.drop(["End station", "Start station"], 1, inplace=True)