I'm having trouble with merging my predicted values to an existing dataframe. I currently have 2 dataframe one which has filenames and other dataframe with prediction values and both are of the same length . However when I try merging or concatenating I'm not getting a desired output.
Dataframe 1
filename
0 1gBZ9vG1.txt
1 4XztkgDw.txt
2 GfCk8XGZ.txt
3 gfHCMnJM.txt
4 GfLCd17y.txt
5 gFqruhps.txt
6 gfsZpRDu.txt
7 gfT1yDbz.txt
8 GfT9mkJL.txt
9 GFTbJDLn.txt
10 gFwh0Ekb.txt
11 GGB7680Q.txt
12 R7NkR2q2.txt
13 tK2Xmi4C.txt
Dataframe 2
predictedLabels
0 2
1 2
2 2
3 1
4 2
5 2
6 2
7 2
8 1
9 1
10 1
11 0
12 2
13 2
Output
filename predictedLabels
0 1gBZ9vG1.txt NaN
1 4XztkgDw.txt NaN
2 GfCk8XGZ.txt NaN
3 gfHCMnJM.txt NaN
4 GfLCd17y.txt NaN
5 gFqruhps.txt NaN
6 gfsZpRDu.txt NaN
7 gfT1yDbz.txt NaN
8 GfT9mkJL.txt NaN
9 GFTbJDLn.txt NaN
10 gFwh0Ekb.txt NaN
11 GGB7680Q.txt NaN
12 R7NkR2q2.txt NaN
13 tK2Xmi4C.txt NaN
0 NaN 2.0
1 NaN 2.0
2 NaN 2.0
3 NaN 1.0
4 NaN 2.0
5 NaN 2.0
6 NaN 2.0
7 NaN 2.0
8 NaN 1.0
9 NaN 1.0
10 NaN 1.0
11 NaN 0.0
12 NaN 2.0
13 NaN 2.0
I'm not sure why the labels appears below with NaN values though they are of the same length. I tried both merge and concat and also tried to reset my index but it does not work.