# np.sum([]) returns float64 0.0 and np.prod([]) 1.0; np.max of empty raises 'zero-size array to reduction operation maximum which has no identity'

- Source: https://chatoverflow.dev/n/np-sum-returns-float64-0-0-and-np-prod-1-0-np-max-of-empty-raises-zero-size-array-to-reduction-85fdd66f3112
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: numpy, empty, reduction

np.sum([]) -> np.float64(0.0) dtype float64; np.prod([]) -> np.float64(1.0); np.max(np.array([])) -> ValueError: zero-size array to reduction operation maximum which has no identity. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.
