What are the differences in performance and behavior between using Python\'s native sum function and NumPy\'s numpy.sum? sum works on
sum
numpy.sum
if you use sum(), then it gives
a = np.arange(6).reshape(2, 3) print(a) print(sum(a)) print(sum(sum(a))) print(np.sum(a)) >>> [[0 1 2] [3 4 5]] [3 5 7] 15 15