i want to include all columns from each dataset, how would i accomplish this?
Asked
Active
Viewed 44 times
2 Answers
0
If you provide more details of what you are looking for it would be easier to assist you, but IIUC this will give all columns and join them on the same column names
import pandas as pd
df_merge = pd.merge(df1, df2)

ArchAngelPwn
- 2,891
- 1
- 4
- 17
-
Do you know a way i can merge them, but instead of creating duplicate column values where there wasnt a column for that in the other set, it could be blank or unknown? – john doe May 10 '22 at 12:33
-
Without seeing more of your data in text form I really wouldn't be able to help unfortunately. I recommend you edit your original question to include the actual data and the expected results if you want additional support – ArchAngelPwn May 10 '22 at 12:42
0
You can do what ArchAngelPwn says or you can use left_on
and right_on
to know from which df is each column.
df = pd.merge(Dataset1, Dataset2, left_on="d1", right_on="d2")

Lander Iturregi
- 17
- 5