I have the following issue: I want to concat or merge two dataframes with different length and partly different indexes:
data1:
index | data1 |
---|---|
1 | 16 |
2 | 37 |
3 | 18 |
7 | 49 |
data2:
index | data2 |
---|---|
2 | 74 |
3 | 86 |
4 | 12 |
6 | 97 |
12 | 35 |
They should be merged in the way, that the output looks like:
index | data1 | data2 |
---|---|---|
1 | 16 | NaN |
2 | 37 | 74 |
3 | 18 | 86 |
4 | NaN | 12 |
6 | NaN | 97 |
7 | 49 | NaN |
12 | NaN | 35 |
I hope you can help me out.
Thanks in advance