You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
499 B
22 lines
499 B
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() |