机器学习基础-numpy

一、相关知识点

二、例子:

python 复制代码
import matplotlib.pyplot as plt
import numpy as np

plt.rcParams['font.sans-serif'] = ['KaiTi']  # 使用黑体
plt.rcParams['axes.unicode_minus'] = False  # 解决负号显示问题

math = np.random.randint(low=60,high=100,size=50)
english = np.random.randint(low=60,high=100,size=50)
physics = np.random.randint(low=60,high=100,size=50)

score = np.array([math,english,physics])
mean_arr = np.mean(score,axis=1)
print(mean_arr)

labels = ["math","english","physics"]
plt.bar(labels,height = mean_arr,color=['red',"green","blue"])
plt.xlabel("科目")
plt.ylabel("平均成绩")
plt.title("学生考试成绩分析",fontsize=20)

plt.show()
相关推荐
Ts-Drunk几秒前
[特殊字符]深度解剖!Hermes-Agent 源码全解析(架构+核心流程+二次开发指南)
人工智能·架构·ai编程·hermes
格林威1 分钟前
AI视觉项目部署:Docker 部署视觉服务可行性分析
linux·运维·人工智能·数码相机·docker·容器·工业相机
Hy行者勇哥4 分钟前
AI超级全景图(100+工具版)
人工智能
cyyt4 分钟前
深度学习周报(4.6~4.12)
人工智能·深度学习
ofoxcoding5 分钟前
OpenClaw Nanobot 架构拆解:从源码学会 AI Agent 的骨架设计(2026)
人工智能·ai·架构
墨北小七6 分钟前
LSTM:一个能“记住”故事的神经网络
人工智能·神经网络·lstm
hero_heart8 分钟前
YOLO 图像识别及C++配置
人工智能·yolo·机器学习
飞舞哲8 分钟前
含模型不确定性的机械臂神经网络状态反馈自适应控制
人工智能·神经网络·数学建模
独隅10 分钟前
PyTorch 文本生成完整代码模板与深度解析
人工智能·pytorch·python
恋猫de小郭10 分钟前
AI 的公开测评得分都在作弊,就像泡面的封面,一切以实物为准
前端·人工智能·ai编程