Last active
September 10, 2023 13:31
-
-
Save Veticus/dbfc03fa575ebf4f7541cc0202e74f35 to your computer and use it in GitHub Desktop.
distribution of numbers by first digit, from 1.6 milion randomly generated numbers
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
import numpy as np | |
import matplotlib.pyplot as plt | |
dist_nums = [834109, 193930, 83203, 83448, 83712, 83123, 83335, 83304, 83044] | |
rangenums = [i for i in range(1, 10)] | |
dist_vals = list(zip(rangenums, dist_nums)) | |
labels, values = zip(*dist_vals) | |
indexes = np.arange(len(labels)) | |
width = 1 | |
plt.bar(indexes, values, width) | |
plt.xticks(indexes + width * 0.5, labels) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment