Error in user YAML: (<unknown>): found a tab character that violate indentation while scanning a plain scalar at line 3 column 3
---
- oeasy Python 0821
- 这是 oeasy 系统化 Python 教程,从基础一步步讲,扎实、完整、不跳步。愿意花时间学,就能真正学会。
- 本教程同步发布在:
- 个人网站: `https://oeasy.org`
- 蓝桥云课: `https://www.lanqiao.cn/courses/3584`
- GitHub: `https://github.com/overmind1980/oeasy-python-tutorial`
- Gitee: `https://gitee.com/overmind1980/oeasypython`
---这是一段示例实验介绍。
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
plt.rcParams['font.sans-serif'] = ['WenQuanYi Zen Hei']
plt.rcParams['axes.unicode_minus'] = False
# 生成一年内不同城市的每日温度数据
np.random.seed(42)
data = {
'北京': np.random.normal(15, 12, 365), # 平均15度,标准差12
'上海': np.random.normal(18, 10, 365), # 平均18度,标准差10
'广州': np.random.normal(22, 8, 365), # 平均22度,标准差8
'哈尔滨': np.random.normal(5, 15, 365), # 平均5度,标准差15
'昆明': np.random.normal(16, 5, 365) # 平均16度,标准差5
}
plt.figure(figsize=(12, 6))
sns.violinplot(data=data)
plt.title('不同城市全年温度分布')
plt.ylabel('温度 (°C)')
plt.xlabel('城市')
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
- 本文来自 oeasy Python 系统教程。
- 想完整、扎实学 Python,
- 搜索 oeasy 即可。
