'How would i merge these two datasets keeping columns from each? [duplicate]
Solution 1:[1]
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)
Solution 2:[2]
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")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ArchAngelPwn |
| Solution 2 | Lander Iturregi |
