带 pyplot 的箱线图

时间:2021-06-24 11:58:21

标签: python matplotlib boxplot

我正在尝试为我从 pyspark 转换为 Pandas 的大型数据集(超过一百万条记录)绘制一个简单的箱线图,以执行一些初步数据分析。问题是,当我尝试用箱线图可视化特征之一时,y 轴并没有反映真实值(或者至少它重新调整了我认为的一切)。

# Describe basic statistics for the features (1)
DF.select('#followers', '#friends', '#favorites').describe().show()

enter image description here

df_pandas = DF.toPandas()

fig = plt.figure(figsize =(10, 7))
 
# Creating plot
plt.boxplot(df_pandas["#followers"])
 
# show plot
plt.show()

enter image description here

0 个答案:

没有答案