numpy.sum[arr, axis, dtype, out] : This function returns the sum of array elements over the specified axis.
Parameters :
arr : input array.
axis : axis along which we want to calculate the sum value. Otherwise, it will consider arr to be flattened[works on all the axis]. axis = 0 means along the column and axis = 1 means working along the row.
out : Different array in which we want to place the result. The array must have same dimensions as expected output. Default is None.
initial : [scalar, optional] Starting value of the sum.
Return : Sum of the array elements [a scalar value if axis is none] or array with sum values along the specified axis.
Code #1:
Python3
# Python Program illustrating
# numpy.sum[] method
import
numpy as np
# 1D array
arr
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False1
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False2
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False4
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False5
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False4
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False8
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]0
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]1
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]2
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]4
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]6
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]2
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]9
# Python Program illustrating
0 # Python Program illustrating
1Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# Python Program illustrating
3Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
# Python Program illustrating
5Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]9
# Python Program illustrating
0 # Python Program illustrating
9Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# Python Program illustrating
3Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
# numpy.sum[] method
3Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]2
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
# numpy.sum[] method
6Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
1import
2import
3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
8
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
numpy as np
0Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
3numpy as np
6 numpy as np
7import
2import
3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
3numpy as np
6
6Output:
Sum of arr : 36.2 Sum of arr[uint8] : 36 Sum of arr[float32] : 36.2 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : True
Code #2:
Python3
# Python Program illustrating
# numpy.sum[] method
import
numpy as np
# 1D array
2
arr
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
# 1D array
5# 1D array
6Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
# 1D array
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
arr
0Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
arr
2Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
arr
4arr
5import
2
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False1
arr
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False00
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False02
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False04
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False06
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False07
import
2
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False1
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False10
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False4
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False14
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False16
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False19
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]2
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]4
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]6
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]2
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]9
# Python Program illustrating
0 # Python Program illustrating
1Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# Python Program illustrating
3Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
# Python Program illustrating
5Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]9
# Python Program illustrating
0 # Python Program illustrating
9Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# Python Program illustrating
3Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
# numpy.sum[] method
3Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]2
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
# numpy.sum[] method
6Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
1Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False50
import
3Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
8
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
numpy as np
0Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
3numpy as np
6 numpy as np
7Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False66
import
3Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
# numpy.sum[] method
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
import
3numpy as np
6
6Output:
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False
Code #3:
Python3
# Python Program illustrating
# numpy.sum[] method
import
numpy as np
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False81
arr
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
# 1D array
5# 1D array
6Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
# 1D array
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
arr
0Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
arr
2Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
arr
4arr
5import
2
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False1
arr
8Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False00
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False02
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False04
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False06
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False07
import
2
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False1
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False10
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False4
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False14
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False16
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False19
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]2
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]4
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]6
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]9
# Python Program illustrating
0 Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]27
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]29
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]30
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]32
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]29
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]35
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]9
# Python Program illustrating
0 Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]27
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False16
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]30
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]32
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False16
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]35
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]3
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]49
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]50
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]51
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]52
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]53
import
3Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]5
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]32
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False16
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]59
Sum of arr : 279 Sum of arr[uint8] : 23 Sum of arr[float32] : 279.0 Is np.sum[arr].dtype == np.uint : False Is np.sum[arr].dtype == np.float : False0
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]51
Sum of arr : 279 Sum of arr[axis = 0] : [52 25 93 42 67] Sum of arr[axis = 1] : [120 75 84] Sum of arr [keepdimension is True]: [[120] [ 75] [ 84]]35