Created
April 11, 2020 01:09
-
-
Save akochepasov/999829601e631eb9b2cf289b0890c0d4 to your computer and use it in GitHub Desktop.
Frequency heatmap creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating heatmap (slower) | |
dbins = np.linspace(0.0, 1.0, 51) | |
m = np.zeros((len(dbins), len(x_axis))) | |
m2 = np.zeros((len(dbins), len(x_axis))) | |
for r in res: | |
rd = np.digitize(r, dbins) | |
for i, d in enumerate(rd): | |
m[d, i] += 1 | |
# Creating heatmap (faster) | |
dbins = np.linspace(0.0, 1.0, 51) | |
m2 = np.zeros((len(dbins), len(x_axis))) | |
for i, x in enumerate(x_axis): | |
h = np.histogram(res[:, j], dbins)[0] | |
m2[1:, i] += h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment