0

I have different dataframes in pandas for different years data like this:

Table 2019:

Name    A    B    C    D    Total
row_1   8    5    1    4     18
row_2   2    2    2    6     12
row_3   4    7    7    4     22

Table 2020:

Name    A    B    C    D    Total
row_1   4    6    2    3     15
row_3   5    4    7    7     23
row_4   3    9    8    9     29

And would like to combine them in:

Table A

Name    2019A    2020A
row_1     8        4
row_2     2        -
row_3     4        5
row_4     -        3

But I'm having trouble combining the tables and recognizing it hast different rows. How could I do it?

Combine dataframes in Pandas

0 Answers0