I know that one can generate an (arithmetic) progression with numpy like so:
>>> import numpy as np
>>> np.arange(10, 60, 10)
array([10, 20, 30, 40, 50])
So my question is can I call something that will do the reverse ?
E.g. :
>>> progression(np.array([10, 20, 30, 40, 50]))
(10, 60, 10)
This is most probably not trivial, but it would be nice if there's something in numpy/scipy that can do an approximation. Also bonus points if it can recognize the type of progression without specifying.
Note: I'm aware there are similar questions already asked, but this one specifically hasn't been answered, I think.