📜  sciPy stats.describe()函数| Python

📅  最后修改于: 2022-05-13 01:55:28.572000             🧑  作者: Mango

sciPy stats.describe()函数| Python

scipy.stats.describe(array, axis=0)沿数组的指定轴计算传递的数组元素的描述性统计信息。

代码#1:

# FInding statistics of data
  
from scipy import stats
  
arr1 = [9, 3, 27] 
   
desc = stats.describe(arr1)
  
print("No. of observations is :\n", desc) 
输出:


代码 #2:使用多维数据

# FInding statistics of data
  
from scipy import stats
  
arr1 = [[1, 3, 27], 
        [3, 4, 6], 
        [7, 6, 3], 
        [3, 6, 8]] 
   
desc = stats.describe(arr1, axis = 0)
  
  
print("No. of observations at axis = 0 :\n\n", desc)
  
  
print("\n\nNo. of observations at axis = 1 :\n\n", desc)
输出: