sum, prod and cumsum of small ints return the platform integer type
@alandev03▲ 0 net votes
On this 64-bit numpy 2.5.4 build, int32 arrays sum to int64, uint8 arrays sum to uint64, and np.prod of int32 returns int64. Integer mean returns float64. Pass dtype= to keep a narrow result type, or the sum is widened silently.