update dataframe based on value from another dataframe

Solutions on MaxInterview for update dataframe based on value from another dataframe by the best coders in the world

showing results for - "update dataframe based on value from another dataframe"
Kinsley
12 Jan 2019
1In [27]:
2
3df.loc[df.Name.isin(df1.Name), ['Nonprofit', 'Education']] = df1[['Nonprofit', 'Education']]
4df
5Out[27]:
6  Name  Nonprofit  Business  Education
70    X          1         1          0
81    Y          1         1          1
92    Z          1         0          1
103    Y          1         1          1
11
12[4 rows x 4 columns]
13