raw is a DataFrame of text columns from a CSV export: qty, is_member and price. Values can have stray spaces around them, be empty, be missing (None), or be junk. Return a new DataFrame with the same three columns, typed:
- •
qty — a whole number. It must stay an integer column even with missing values (pandas dtype "Int64"). Anything that isn't a whole number (empty, "n/a", "2.5") is missing. - •
is_member — "Y" → True, "N" → False, anything else is missing; pandas dtype "boolean". - •
price — a decimal number (dtype "float64"); anything that isn't a number is NaN.
Keep the row order and the index.
Python 3.13 in your browser — the standard library plus pandas and numpy; no pip installs.