# A question about the ArrayResample

I have a confusion with the function of ArrayResample.This is a illustrative picture in Details and Options about the method of "Bin":

Then I make a example like this:

list = {1, 1.5, 2.5, 3.5, 4.5};
NumberLinePlot[{list, ArrayResample[list, 7, "Bin"]}]


I find the result is very hard to understand

{ArrayResample[list, 7, "Bin"],
ArrayResample[list, 7, "Bin"] // Differences}


{{1, 9/7, 25/14, 5/2, 45/14, 55/14, 9/2}, {2/7, 1/2, 5/7, 5/7, 5/7, 4/7}}

I think the illustrative picture above just can explain the case when list = {0.5, 1.5, 2.5, 3.5, 4.5} but the case when list = {1, 1.5, 2.5, 3.5, 4.5}.Do anybody have a similar opinion?

• By the way, I think NumberLinePlot is misleading in any case. Remember, that the values taken as input and given as output are intended to be "y-coordinates", not "x-coordinates", if you will. – LLlAMnYP Feb 15 '16 at 23:28
• @LLlAMnYP I get it.Thank you for such a good summary. – yode Feb 15 '16 at 23:49

ArrayResample uses "Fixed" Padding by default and linear resampling.

So ArrayResample[list, 7, "Bin"] is equivalent to

padlist = {First@# - {1, 0}}~Join~#~Join~{Last@# + {1, 0}} &@
Transpose[{Range[Length[list]] - 1/2, list}]
f = Interpolation[padlist, InterpolationOrder -> 1]
f /@ (5/7*(Range[7] - 1/2))
(* {1, 9/7, 25/14, 5/2, 45/14, 55/14, 9/2} *)


The figure below is more accurate, than what is in the docs:

Black points are original data, red - resampled, as for the "Bin" method with 5 initial points and 7 final points. I modified the initial list to get a nicer figure for this.