Code Room
Code reviewMediumcr-g635
Subject Ml data qualityLevel Mid–Senior~16 minCommon in ML systems interviewsIndustries Software development

Question

Review this Python feature-loading code.

Model performance quietly drops after an upstream export-format change, but nothing errors. What dtype/data bug is hiding here?

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewpython
import pandas as pdimport numpy as np def load_features(path):    df = pd.read_csv(path)    # 'amount' sometimes has values like '1,200' or 'N/A' from the export    X = df[["amount", "age", "score"]].astype(str)    X = X.apply(lambda c: c.str.replace(",", ""))    X = X.apply(pd.to_numeric, errors="coerce")    X = X.fillna(0)    return X.values
Run or narrate your approach, then ask the coach.