I don't know if this could be consider a join/merge/concatenate or something else but this is what is happening: I have two pandas dataframes (df1, df2) and I am trying to put them together so I could have something similar to the result below:
df1 = pd.DataFrame({'index': [0, 1], 'column A': ['item_a', 'item_b']})
| index | column A |
|---|---|
| 0 | item_a |
| 1 | item_b |
df2 = pd.DataFrame({'index': [0, 1, 2], 'column B': [11, 22, 34]})
| index | column B |
|---|---|
| 0 | 11 |
| 1 | 22 |
| 2 | 34 |
Desired Output:
| index | column A | column B |
|---|---|---|
| 0 | item_a | 11 |
| 1 | item_a | 22 |
| 2 | item_a | 34 |
| 3 | item_b | 11 |
| 4 | item_b | 22 |
| 5 | item_b | 34 |
I tried most of the regular (merge, concat, etc.) and I still can't figure out what I was doing wrong?
Does anyone have any idea of what I should do?