制作直方图时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/