我对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。
这怎么办?