1arr = [[14, 17, 12, 33, 44],
2 [15, 6, 27, 8, 19],
3 [23, 2, 54, 1, 4, ]]
4
5# mean of the flattened array
6print("\nmean of arr, axis = None : ", np.mean(arr))
7
8mean of arr, axis = None : 18.6
9
10# mean along the axis = 0
11print("\nmean of arr, axis = 0 : ", np.mean(arr, axis = 0))
12
13mean of arr, axis = 0 : [17.33333333 8.33333333 31. 14. 22.33333333]
14
15# mean along the axis = 1
16print("\nmean of arr, axis = 1 : ", np.mean(arr, axis = 1))
17
18mean of arr, axis = 1 : [24. 15. 16.8]