parent
9daba3a9aa
commit
6c734cfb90
@ -0,0 +1,22 @@
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
|
||||
# 加载数据
|
||||
df = pd.read_csv('/mnt/豆瓣电影_20250510_173909.csv')
|
||||
|
||||
# 设置图片清晰度
|
||||
plt.rcParams['figure.dpi'] = 300
|
||||
|
||||
# 设置中文字体
|
||||
plt.rcParams['font.sans-serif'] = ['WenQuanYi Zen Hei']
|
||||
|
||||
# 绘制评分的直方图
|
||||
plt.figure(figsize=(10, 6))
|
||||
sns.histplot(df['评分'], bins=10, kde=False)
|
||||
plt.title('评分分布直方图')
|
||||
plt.xlabel('评分')
|
||||
plt.xticks(rotation=45)
|
||||
plt.ylabel('频数')
|
||||
|
||||
plt.show()
|
Loading…
Reference in new issue