0

Newbie to pandas

I have got two df and merge them according to id

I tried with outer join and couldn't able to do that

df1

            id          name        count

0           1001        a           1
1           1002        b           2
2           1003        c           3
3           1004        d           4
4           1005        e           5

df2

            id          aplhabet        phonenumber

0           1001        apple           1000005
1           1002        ball            2000005
2           1003        cat             3000005
3           2222        crocs           2222222
4           1004        dog             4000005
5           1005        elephant        5000005
6           3333        sssssss         6666666
7           4444        fffffff         7777777

Final df:

            id          name      count     aplhabet         phonenumber

0           1001        a           1       apple            1000005
1           1002        b           2       ball             2000005
2           1003        c           3       cat              3000005
3           1004        d           4       dog              4000005
4           1005        e           5       elephant         5000005

0 Answers0