what would you call this function?

xxx([1, 2, 3], 4) => [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]

Follow

@nasser it's 1 dimensional nearest neighbor scaling, so I would initially call it
scale1_nearest(data, factor).

I would then generalize it to support different filters and fractional sealer, and call it
scale1(data, scaler, filter = nearest).

Still unsatisfied I would try to generalize it to N dimensions, preferably inferred from the parameters, so that I can call it simply
scale(data, scaler, filter = nearest).

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.