3

x と y のサイズが異なる x と y の numpy histogram2d を作成しようとしています。ドキュメントから、x と y は同じサイズである必要がありますが、私のデータとアプリケーションでは、ヒストグラムの x​​ と y の次元が異なる必要があります。

bins = 100
x = np.random.normal(3, 1, 100)
y = np.random.normal(1, 1, 150)
np.histogram2d(x, y, bins)[0]

私にくれます

ValueError: operands could not be broadcast together with shapes (100,) (150,) 
4

0 に答える 0