Find the addresses at one domain
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) -> dataframeExample 1
Input
at_domain(contacts, "x.com")contacts
| name | |
|---|---|
| a@x.com | Ann |
| b@x.com | Bob |
| a@x.com | Ann |
| c@x.com | Cy |
| b@x.com | Bobby |
Output
| name | |
|---|---|
| a@x.com | Ann |
| a@x.com | Ann |
| b@x.com | Bob |
| b@x.com | Bobby |
| c@x.com | Cy |