I have the following two dataframes: The 1st column is the index and the last column is derived from the index by appending a '.txt' to it.
A
1 0.2 0.3 1.txt
2 0.4 0.6 2.txt
B
1 0.1 0.8 1.txt
2 3.0 4.5 2.txt
I would like to combine them so:
1 0.2 0.3 1.txt
2 0.4 0.6 2.txt
3 0.1 0.8 3.txt
4 3.0 4.5 4.txt
I tried using pandas merge, but not sure of how to go about it without explicitly iterating using a for loop. Any suggestions?