Aggregation
Use aggregation techniques to combine NumPy data and arrays.
We'll cover the following...
Chapter Goals:
- Learn how to aggregate data in NumPy
- Write code to obtain sums and concatenations of NumPy arrays
A. Summation
As we know how to calculate the sum of individual values between multiple arrays. To sum the values within a single array, we use the np.sum function.
The function takes in a NumPy array as its required argument, and uses the axis
keyword argument. If the axis
keyword argument is not specified, np.sum
returns the overall sum of the array.
The code below shows how to ...
Access this course and 1400+ top-rated courses and projects.