I have data that looks like this:
x: 0, 1, 2, 3, 4,...
y: 1, 3, 1, 4, 2,...
Where y is the frequency list for each element in x.
Firstly I want to get the data showed as the following:
data: 0, 1, 1, 1, 2, 3, 3, 3, 3, 4, 4,...
I would like to extract the mean and the median of these values. So the mean should be 2.27 and the median should be 3.
I'm wondering what would be the best way to do, whether to create a dictionary with x and y values or something else.
Thanks in advance.