np array describe

>>> from scipy import stats
>>> a = np.arange(10)
>>> stats.describe(a)
DescribeResult(nobs=10, minmax=(0, 9), mean=4.5, variance=9.166666666666666,
               skewness=0.0, kurtosis=-1.2242424242424244)
>>> b = [[1, 2], [3, 4]]
>>> stats.describe(b)
DescribeResult(nobs=2, minmax=(array([1, 2]), array([3, 4])),
               mean=array([2., 3.]), variance=array([2., 2.]),
               skewness=array([0., 0.]), kurtosis=array([-2., -2.]))

Here is what the above code is Doing:
1. We’re creating a NumPy array with 10 elements.
2. We’re using the describe() function from the scipy.stats module to calculate some statistics about our array.
3. We’re creating a 2D NumPy array with 2 rows and 2 columns.
4. We’re using the describe() function from the scipy.stats module to calculate some statistics about our 2D array.

As you can see, the describe() function can be used to calculate statistics for both 1D and 2D NumPy arrays.