numpy中的ndarray聚合操作
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# 1.求和np.sum
n = np.random.randint(0, 150, size=(4, 4, 4))
print(n)
print(np.sum(n))
# 最大最小值:np.max/np.min
image = plt.imread('DSC.JPG')
print(image.shape)
print(image.max(), image.min())
# 求所有值的平均值
# print(np.mean())
#print(np.mean(a=n, axis=0))
# 操作文件
# 使用pandas打开.csv文件,获取文件中的数据
df = pd.read_csv('winequality-red.csv')
print(df)
print(df.values)