Data Cleaning Exercises

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.

Input: people, rows 1 to 9 of 9
#idstringnamestring
1pxbnyFrançois Côté⇥ (raw value "François Côté\t")
2pyy5hplain name⇥ (raw value "plain name\t")
3pyxapÖlçer Çağlar⇥ (raw value "Ölçer Çağlar\t")
4p4oqr·Zoë Brontë·⍽ (raw value " Zoë Brontë  ")
5pw9op▯Müller & Söhne⇥ (raw value " Müller & Söhne\t")
6p49xg⇥Nguyễn Văn An· (raw value "\tNguyễn Văn An ")
7pgtkr▯Łukasz Żak· (raw value " Łukasz Żak ")
8p3chdÅngström Lab⍽ (raw value "Ångström Lab ")
9p2bzh⇥Ł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.

AI tutor · may be wrong; the grader decides

Python · Python 3.14 · pandas 3.0.2Preview runtime loadingNot saved yet · sign in to save to your account