When conducting an analysis, we often need to find the mean, standard deviation and minimum/maximum values.
Let's start with a 2D array, which is the most common for data analysis.
Use .mean
to find the mean of elements in an array. You can find the mean of all elements, or find the mean of elements in rows or columns by specifying the axis.
Now let's verify the information above:
Use np.sum
to sum all elements in the matrix. You can also specify the axis to sum by rows or columns.
Use np.std
to find the standard deviation of all elements in the matrix. You can also specify the axis to find the standard deviation of rows or columns.
Use .min
and .max
to find the minimum and maximum of the entire matrix. You can also specify the axis for rows and columns.
You are expected to comply with University policies and guidelines namely, Appropriate Use of Information Resources Policy, IT Usage Policy and Social Media Policy. Users will be personally liable for any infringement of Copyright and Licensing laws. Unless otherwise stated, all guide content is licensed by CC BY-NC 4.0.