# KeyError: "['column_name'] not in index"

- **ID:** `python/pandas-keyerror-column-not-found`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Column name mismatch, often due to leading/trailing whitespace, case difference, or reading a CSV with a header offset so the expected column is actually a row value.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   df.columns = df.columns.str.strip(); print(df.columns.tolist())
   ```
2. **** (85% success)
   ```
   pd.read_csv(path, skiprows=1) or header=0 to align headers
   ```

## Dead Ends

- **** — Same KeyError, column still absent (90% fail)
- **** — Returns None silently, downstream operations then crash (70% fail)
