Last active
March 12, 2019 15:50
-
-
Save jenncross/4a07f17efc5db8c0be87cdbd583812cb to your computer and use it in GitHub Desktop.
Dice Roll Data
This file contains 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 random | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import dice # My custom module | |
rollsums = testSums(1, 100) | |
plt.figure() | |
plt.hist(rollsums, | |
bins = np.arange(rollsums.min(),rollsums.max()+1)+.5, | |
rwidth = .75) | |
plt.xlabel("Sample") | |
plt.ylabel("Roll Total") | |
plt.show() | |
plt.figure() | |
plt.hist(rollsums, | |
bins = np.arange(rollsums.min(),rollsums.max()+1)+.5, | |
rwidth = .75) | |
plt.xlabel("Roll Total") | |
plt.ylabel("Count") | |
plt.show() | |
myTable = pd.crosstab(index=rollsums, columns="count") | |
print(myTable) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment