python-3.x - Python 中 Bins 的含义?

标签 python-3.x matplotlib histogram

制作直方图时bins=50的含义是什么以及BIN在Boxplot中的作用。

df['ApplicantIncome'].hist(bins=50)

感谢和问候

最佳答案

To construct a histogram, the first step is to "bin" (or "bucket") the range of values—that is, divide the entire range of values into a series of intervals.

更多信息请点击:https://en.wikipedia.org/wiki/Histogram

因此,如果您选择等于 50 的 bin,那么您的输入将被分为 50 个间隔或 bin(如果可能)。

在 matplotlib 中,您还可以让它在给定数据的最新版本中自动生成 bin,或者您也可以提供自定义序列。

有关 bins 的 matplotlib 的更多具体信息可以在这里找到:https://matplotlib.org/api/_as_gen/matplotlib.pyplot.hist.html

关于python-3.x - Python 中 Bins 的含义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51491391/

相关文章:

python - 如何从 Counter 的值构建直方图?

Python 控制台提示在 PyCharm 中显示 In[] Out[] 而不是 >>>

python - Pandas 空数据帧由 isin 函数生成,如果 ID 存在于仅包含 ID 的数据帧中,则该函数会保留具有 ID 的对象

python - 在 seaborn 热图上显示日期

r - 如何将曲线拟合到直方图

r - 谁能解释为什么创建具有两个条件的直方图显示 R 中的分布不正确?

python - 如何将字符串作为单个项目放入集合中?

django - "IntegrityError. NOT NULL constraint failed: blog_comment.post_id "代表什么?

matplotlib - 无法在 Pandas 条形图中调整 x 轴日期格式

python - 尝试使用 Matplotlib 的子图功能时如何阻止出现空白图?