I have a 2D dataset like this one: {{x1,y1}, {x2,y2},...}
I need to smooth/histogram the data in such a way that binning is over the x-coordinate, while counting/height is over the y-coordinate. Let me explain.
Given the following input, bin-width = 0.2 and height-function = Mean[].
data = {{0.1,1.0}, {0.2,2.0}, {0.3,3.0}, {0.35,3.5}, {0.4,4.0}, {0.5,5.0}};
The output would be:
{(1 + 2)/2, (3 + 3.5 + 4)/3, 5/1}
The average of y-values from the first two data points goes into the first bin, the following three points form the second bin etc...
0.29and0.31-- shouldn't these be in separate bins? – Mr.Wizard May 07 '12 at 19:35$MachineEpsilonis too small a number to add here if the $x$-values are greater than 1. (I added a note about this.) – Szabolcs May 07 '12 at 19:37Ceiling[#, 0.2]? – Mr.Wizard May 07 '12 at 19:390.1, 0.3, 0.5which was my own reading, this is more complicated I think. – Mr.Wizard May 07 '12 at 19:45