My interpretation is that you want to downsample a signal with an asynchronous frequency.
One way to do this is to implement a kind of Digital PLL (Phase Lock Loop).
Let us assume that you have N = 1030 elements at input and that you want to get K = 100 elements.
The average rate is equal to rate = 10.3.
In practice, you will have to use a step equal to 10 or 11 depending of the current position of the indices.
If you are in "advance" : step = 10 (slow down)
If you are "late" : step = 11 (speed up)
Test to know if you late or in advance:
The current "read" index i is equal to the sum of the former steps.
k is the output index
if i < rate*k : you are late
else you are in advance
This is the basic idea. Some small adaptations are possible, for example to insure getting the last element.
EDIT: I just 'rediscovered' Mathieu Brucher's solution. In my first too fast reading of it, I was misled by the original error (corrected) on step calculation in his answer. It is clear that results will be equivalent, except that Mathieu Brucher's implementation is simpler. In this situation, the only interest (?) of my answer is to provide another interpretation of the process