0
How to combine two columns in pandas?
Df= Dataframe({'num1':[1,2,3], 'num2': [4,5,6]} And result= [1,2,3,4,5,6]
1 Answer
0
Nabanita Borkakoti you need two square brackets to insert a list into a cell.
import pandas as pd
df= pd.DataFrame({'num1':[[1,2,3]], 'num2': [[4,5,6]]})
df['result']= df['num1']+ df['num2']
print(df)