在binned_statistic_2d中指定垃圾箱边缘

时间:2019-06-17 21:40:50

标签: python-3.x scipy binning

我对python的binned_statistic_2d方法感到困惑。我正在按如下方式使用它:

from scipy import stats
heatmap, xedges, yedges, binnumber = stats.binned_statistic_2d(x, y, values=z, statistic='mean', bins=[1000, 1777], range=[[0,1080], [0,1920]])

在PyCharm中,我收到以下范围警告:

  

预期类型为“可选[int]”,改为使用“列表[List [int]]”

documentation中,它是为range参数编写的:

  

每个维度上垃圾箱的最左边和最右边(如果   未在bins参数中明确指定):[[xmin,xmax],   [ymin,ymax]。所有超出此范围的值将被考虑   异常值,并且在直方图中未统计。

我想要的是第一个尺寸为1000箱,最左边为0,最右边为1080;第二个尺寸为1箱,最左边为0,最右边为1920。

这怎么办?

0 个答案:

没有答案