# ValueError: cannot convert float NaN to integer

- **ID:** `python/numpy-float-to-int-nan`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Attempting to cast a float array containing NaN into an integer dtype, which has no representation for NaN.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   arr = np.nan_to_num(arr, nan=0.0).astype(int)
   ```
2. **** (90% success)
   ```
   pd.Series(arr).dropna().astype(int) or fillna(0).astype(int)
   ```

## Dead Ends

- **** — astype(int) still raises on NaN before truncation (90% fail)
- **** — Silently drops data, corrupts downstream results (70% fail)
