Normalize names without changing letters · Python (pandas)
Task: the rules
Input
people(id, name) — text. id is unique; name is always present.
Rules
name: remove Unicode whitespace at both ends (this includes no-break space U+00A0 and ideographic space U+3000),
then normalize to Unicode NFC. Never remove accents or transliterate (José stays José, not Jose).
Inner spaces are kept as they are.
Output (row order does not matter)
clean(id text, name text)Tab inserts spaces. Press Escape, then Tab, to move focus out of the editor.
| # | idstring | namestring |
|---|---|---|
| 1 | pxbny | François Côté⇥ (raw value "François Côté\t") |
| 2 | pyy5h | plain name⇥ (raw value "plain name\t") |
| 3 | pyxap | Ölçer Çağlar⇥ (raw value "Ölçer Çağlar\t") |
| 4 | p4oqr | ·Zoë Brontë·⍽ (raw value " Zoë Brontë ") |
| 5 | pw9op | ▯Müller & Söhne⇥ (raw value " Müller & Söhne\t") |
| 6 | p49xg | ⇥Nguyễn Văn An· (raw value "\tNguyễn Văn An ") |
| 7 | pgtkr | ▯Łukasz Żak· (raw value " Łukasz Żak ") |
| 8 | p3chd | Ångström Lab⍽ (raw value "Ångström Lab ") |
| 9 | p2bzh | ⇥Łukasz Żak▯ (raw value "\tŁukasz Żak ") |
Run preview · in your browser, not a grade
Loading the preview runtime…
Check answer · graded on an isolated server, including hidden datasets
Your code runs in a locked-down machine with no network, on the visible data and on hidden datasets that follow the same rules.
Learn from this exercise
A worked solution becomes available after your first check or once you've used every hint.