Keep the newest record per email
Your task
Given contacts with columns email and name, where later rows are more recent, keep only the LAST row for each email. Return email and name, sorted by email ascending.
Examples
latest_per_email(contacts: dataframe) -> dataframeExample 1
Input
latest_per_email(contacts)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 |
| b@x.com | Bobby |
| c@x.com | Cy |