I want to make correlation plot(TH2) from two numpy array.
I tried as below but it is too slow and I don’t know how use multi-threading in python… any idea to make more faster?
for i in range(len(img1.flatten())):
for j in range(len(img2.flatten())):
Maybe @etejedor can give you some hints
I solve this problem with np.histogram2d as below.
scatter,x_edge,y_edge = np.histogram2d(img1.flatten(),img2.flatten(),bins=(x_edge,y_edge))
for i in range(scatter.shape):
for j in range(scatter.shape):
where each edges mean binning and scatter is matrix
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.