[Numpy-discussion] subsampling

John J. Lee jjl at pobox.com
Fri Feb 15 12:08:17 EST 2002


On Thu, 14 Feb 2002, Charles G Waldman wrote:

> Mathew Yeates writes:
>
>  > how can I take a matrix and subsample it down to
>  > an arbitrary size? It seems that using slices is
>  > limited to constant integer step sizes while, if
>  > I'm converting between arbitrary sizes, I would like
>  > to subsample at a nonuniform rate.
>
> I'm not sure exactly what you're trying to do, but maybe the following
> Python session will show you the way.
[examples of take() usage snipped]

I think -- correct me if I'm wrong -- he was asking about interpolation.

If a Python loop is too slow, you can probably do it with the standard
numpy functions, with some experimentation.


John





More information about the NumPy-Discussion mailing list