question 414 pandas Foundations · easy
Which rows aren't numbers?
Before converting a column, a loader reports the rows that would fail. Write non_numeric_rows(path, column): return the row positions (0 for the first data row) where column has a value that is not a number. Empty cells are missing, not wrong: don't report them.
Function
non_numeric_rows(path, column)Returnsa list of row positions, in order;
[] when every value is a number or emptyExamples
callnon_numeric_rows('quantities.csv', 'Quantity')returns[1, 3]
callnon_numeric_rows('quantities.csv', 'StockCode')returns[2]
callnon_numeric_rows('signed.csv', 'Quantity')returns[]