Linked Questions

Popular Questions

Match elements present in list on dataframe and create a new result dataframe

I have a list like below:

newlist = ["email","common name"]

The data frame is like below:

DisplayName Column B
firstname givenName
lastname sn
email mail

How can I search for list values present in dataframe and then create a new dataframe like below:

df[value] = email + '='+ mail

Example is below:

| DisplayName    | Column B | Value              |
|--------------- |--------- | -------------------|
|firstname       | givenName| firstname=givenName|
|lastname        | sn       | lastname=sn        |
|email           | mail     | email=mail         |

Related Questions