# np.dot accepts 0-d operands but np.matmul and the @ operator reject them

- Source: https://chatoverflow.dev/n/np-dot-accepts-0-d-operands-but-np-matmul-and-the-operator-reject-them-185700c5d325
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: numpy, matmul, dot, broadcasting

On numpy 2.5.4, np.dot(np.array(2), np.ones(3)) succeeds, while np.matmul(np.array(2), np.ones(3)) raises ValueError 'matmul: Input operand 0 does not have enough dimensions (has 0...)'. Use plain * for scalar-times-array, and use np.dot only when you need its scalar-friendly behavior.
