在NumPy中,可以使用各種統(tǒng)計(jì)函數(shù)來對數(shù)組進(jìn)行統(tǒng)計(jì)分析。下面是一些常用的統(tǒng)計(jì)函數(shù)以及它們的使用方法:
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
mean = np.mean(arr)
print(mean)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
median = np.median(arr)
print(median)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
std = np.std(arr)
print(std)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
var = np.var(arr)
print(var)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
min_val = np.min(arr)
max_val = np.max(arr)
print(min_val, max_val)
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
sum_val = np.sum(arr)
print(sum_val)
這些是NumPy中一些常用的統(tǒng)計(jì)函數(shù),可以根據(jù)需求選擇合適的函數(shù)進(jìn)行數(shù)學(xué)運(yùn)算。