Skip to content

ECO-CMP-PY-013 — Inefficient pandas row iteration

  • Category: Computation (CMP)
  • Family: Python (PY)
  • Layer: Code
  • Tier: 1
  • Severity: warning
  • Tags: python, pandas, cpu
  • Legacy ID: ECO-PY-013

Summary

Row-wise pandas iteration is slow compared to vectorized operations.

Rationale

Vectorization reduces Python-level overhead dramatically.

Impact

{
  "confidence": 0.8,
  "notes": "High in analytics/ETL.",
  "type": "cpu"
}

Detection

{
  "languages": [
    "python"
  ],
  "method": "ast"
}

Remediation

{
  "guidance": "Use vectorized ops or apply carefully; avoid iterrows in hot paths.",
  "tradeoffs": "Learning curve / refactor time."
}

Ontology

{
  "system_layers": [
    "code"
  ]
}