I have taking probability using randint function. but i am facing issue in histogram to show my probability.
my Probability output like this.
{60: 0.013, 6: 0.016, 99: 0.01, 25: 0.006, 45: 0.017, 51: 0.009, 72: 0.011, 8: 0.015, 10: 0.015, 82: 0.011, 50: 0.014, 43: 0.012, 52: 0.011, 74: 0.015, 12: 0.015, 39: 0.01, 89: 0.014, 7: 0.009}
My python code.
from collections import Counter
import numpy as np
import matplotlib.pyplot as plt
hist = np.random.randint(low=1, high=100, size=1000)
counts = Counter(hist)
total = sum(counts.values())
hist = {k:v/total for k,v in counts.items()}
num_bins = 10
n, bins, patches = plt.hist(hist, num_bins, normed=1, facecolor='blue', alpha=0.5)
#plt.plot(bins, hist, 'r--')
plt.xlabel('Grades')
plt.ylabel('Probability')
plt.title('Histogram of Students Grade')
plt.subplots_adjust(left=0.15)
plt.show()

plt.plot(bins, hist, 'r--')i need just my Probabilty Histogram. where the issue occurs ?'<' not supported between instances of 'dict' and 'float'. and the graph was empty.Dictandfloatfunction to seprate the values first then do the Histogram. like {60: 0.013, 6: 0.016, 99: 0.01} do you understand my issue ?