numpytools: Miscellaneous utilities for working with numpy arrays

Miscellaneous utilities for working with numpy arrays

Functions

astype(a, typedescr)

The same as: if a.dtype != typedescr: a = as.astype(typedescr)

chunks(data, chunksize[, hop, padwith])

Iterate over data in chunks of chunksize.

interlace(*arrays)

Interweave multiple arrays into a flat array in the form

linlin(xs, x0, x1, y0, y1)

Map xs from range x0-x1 to y0-y1

nearestindex(a, grid[, left, right])

For each value in a return the index into grid nearest to it

npunzip(a)

column0, column1, .

npzip(*arrays)

zip 1-D arrays, similar to the built-in zip

overlapping_frames(y, frame_length, hop_length)

Slice a time series into overlapping frames.

padarray(arr, numelements[, padwith])

Pad a 1D array to the right, or a 2D array down

smooth(a[, kind, strength])

Smooth the values in a

zipsort(a, b)

Sort one array, keep the other synched