I am using matplotlib.pyplot to create histograms. I\'m not actually interested in the plots of these histograms, but interested in the frequencies and bins (I know I can write
You can use np.histogram2d (for 2D histogram) or np.histogram (for 1D histogram):
hst = np.histogram(A, bins) hst2d = np.histogram2d(X,Y,bins)
Output form will be the same as plt.hist and plt.hist2d, the only difference is there is no plot.
plt.hist
plt.hist2d