Find the addresses at one domain

Data framesMedium9 min

Your task

Given contacts with columns email and name, and a domain such as x.com, return the rows whose email is at that domain, meaning the part after the @ is exactly the domain. Return email and name, sorted by email ascending and then name ascending.

Examples

at_domain(contacts: dataframe, domain: str) -> dataframe
Example 1
Inputat_domain(contacts, "x.com")
contacts
emailname
a@x.comAnn
b@x.comBob
a@x.comAnn
c@x.comCy
b@x.comBobby
Output
emailname
a@x.comAnn
a@x.comAnn
b@x.comBob
b@x.comBobby
c@x.comCy