Pandas populate new dataframe column based on matching columns in another dataframe

前端 未结 5 1673
花落未央
花落未央 2020-12-25 14:15

I have a df which contains my main data which has one million rows. My main data also has 30 columns. Now I want to add another column

5条回答
  •  一生所求
    2020-12-25 14:44

    While the other answers here give very good and elegant solutions to the asked question, I have found a resource that both answers this question in an extremely elegant fashion, as well as giving a beautifully clear and straightforward set of examples on how to accomplish join/ merge of dataframes, effectively teaching LEFT, RIGHT, INNER and OUTER joins.

    Join And Merge Pandas Dataframe

    I honestly feel any further seekers after this topic will want to also examine his examples...

提交回复
热议问题