Which Ones Broke?

Data with PythonMedium+10 XP+10

Which Ones Broke?

A weather volunteer typed a week of rainfall readings, in millimetres, into a spreadsheet. Most are fine, like "12" or "3.5". A few aren't: "n/a", "3,5" typed with a comma, "twelve", or an empty "".

Before fixing anything, the volunteer wants to see exactly which entries pandas can't read, so they can look them up in their notebook.

Task: write unreadable(readings), where readings is a list of strings.

  • Convert the readings to numbers, turning anything that can't be read into a missing value.
  • Return the original text of every entry that couldn't be read, in the order it appears. Keep repeats: if "n/a" appears twice, it's in the list twice.
  • If every entry could be read, return [].

There is always at least one reading. No reading has spaces in it.

Examples

readings = ["12", "3.5", "n/a", "0", "3,5"]
returns ['n/a', '3,5']
readings = ["4", "7.25", "0.5"]
returns []

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run