From a set of x unique items, I need to repeat each item y times such that y follows a normal distribution.
For example, if number of items n = 5, and y_max = 50. If we count how many times each item in my sorted list is repeated, the visual would look like this:
my_set=('a','b','c','d','e')
distribution = np.random.normal(len(my_set)/2, 1,len(my_set)).round().astype(int)
np.repeat(my_set, distribution)
I expect the result to follow a trend similar to the graph but instead, the result follows either an increasing or decreasing trend.
For readability, I'll use tuples instead of repeating each item y times.
Expected result should be something like:
[('a', 2), ('b', 4), ('c', 5), ('d', 3), ('e', 1)]
Actual result :
[('a', 5), ('b', 4), ('c', 3), ('d', 4), ('e', 3)]