Histogram for discrete values with matplotlib
Given the title of your question, I will assume that the discretization size is constant. You can find this discretization size (or at least, strictly, n times that size as you may not have two adjacent samples in your data) np.diff(np.unique(data)).min() This finds the unique values in your data (np.unique), finds the differences between then … Read more