Skip to content
Advertisement

Pandas creating a column comparing with different sheets

My excel includes id of users in current sheet/user sheet and id and name of the users in another sheet/name. I need to compare id and add the name of users in user sheet.Just as shown in figure.

current sheet another sheet output

Advertisement

Answer

assuming:

sheet1 is ‘s1’

sheet2 is ‘s2’

and names of the columns are user_id,names

you can use dictionary to do this

JavaScript

you can then write the s1 dataframe to a new excel sheet.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement