Python Pandas-Update a data frame column with values from another

后端 未结 2 1129
挽巷
挽巷 2021-01-25 18:50

i\'m trying get better at Python and decided to do some analysis on one of my passions. Wrestling! In this case, Japanese Wrestling!

Basically I\'m trying to update valu

2条回答
  •  甜味超标
    2021-01-25 19:39

    So I am going to assume your first dataframe is called df1 and your second one is called df2. Then this would work:

    df1 = df1.drop('DMR', 1)
    df = merge(df1, df2, on = 'Wrestler')
    

    Just drop DMR from the first dataframe and then merge them on the Wrestler column.

提交回复
热议问题