# ValueError：形状 (3,4) 和 (5,6) 不对齐：4（维度 1）!= 5（维度 0）

- **ID:** `python/numpy-dot-shape-mismatch`
- **领域:** python
- **类别:** type_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

矩阵乘法要求内维相等；此处不匹配。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   A @ B.T if B has shape (6,5) and inner matches
   ```
2. **** (85% 成功率)
   ```
   np.einsum('ij,jk->ik', A, B) for explicit control
   ```

## 无效尝试

- **** — Still mismatched unless dims align (85% 失败率)
- **** — Silently produces wrong result or broadcast error (80% 失败率)
