Function in collections::vec coil-stdlib

windows

fn windows<T>(Vec<T> xs, int size) -> Vec<Vec<T>>
Import
use collections::vec::{windows};
Source: src/collections/vec.hy

Overlapping sliding windows of exact size. Empty if size <= 0 or size > len.

Parameters#

NameType
xsVec<T>
sizeint

Returns#

Vec<Vec<T>>

See also#

  • fold_int: The same as fold; kept for older code.
  • contains: Returns true when needle is in xs.
  • index_of: Returns the index of the first needle in xs, or -1.
  • binary_search: Finds needle in the ascending vector xs by halving, and returns an index holding it.
  • dedup: Returns xs with runs of equal neighbours collapsed to one value.
  • map: Returns a new vector with mapper applied to each element, in order.
  • filter: Returns the elements for which pred is true, in order.
  • first: Returns the first element, or None when xs is empty.
↑ ↓ navigate ↵ open