0

Dataframe 1:

name_a name_b name_c type
a      b      c      type_a
a      b      c      
a      b      c      
a      b      c      type_a
a      b      c      

Dataframe 2:

name_a name_b name_c type
a      b      c      
a      b      c      
a      b      c      type_b
a      b      c      
a      b      c

Dataframe 3:

name_a name_b name_c type
a      b      c      
a      b      c      type_c
a      b      c      
a      b      c  
a      b      c  

Output:

name_a name_b name_c type
a      b      c      type_a
a      b      c      type_c
a      b      c      type_b
a      b      c      type_a
a      b      c

Hello, is there a way for this output? I tried concatenated all the Dataframe with axis=0 so it will stack the Dataframe vertically, used index.name = "id" and reset_index(inplace=True) so i can identify its id.

id name_a name_b name_c type
0  a      b      c      type_a
1  a      b      c      
2  a      b      c      
3  a      b      c      type_a
4  a      b      c      
0  a      b      c      
1  a      b      c      
2  a      b      c      type_b
3  a      b      c      
4  a      b      c      
0  a      b      c      
1  a      b      c      type_c
2  a      b      c      
3  a      b      c      
4  a      b      c      

Then i'm planning to groupby by id and retain the type column that has values but i can't figure it out, is there a way to merge the dataframe without using many methods or you have something another in mind that will work?

Aeria
  • 118
  • 10
  • 2
    Does this answer your question? [Pandas Merging 101](https://stackoverflow.com/questions/53645882/pandas-merging-101) –  Aug 19 '20 at 10:09
  • Thanks. it's not actually solve all of it but with this, its a start. Solved it! – Aeria Aug 19 '20 at 11:16

0 Answers0