StridedBinning#
- class geodesic.tesseract.components.StridedBinning(from_selection={}, from_end=False, duration=None, stride=None, count=None, offset=None, **kwargs)[source]#
Create output time bins based on a from, duration, stride, offset, and count.
This allows you to create a time binning with equal sized bins, but with a stride between each bin. Any data whose datetimes falls into a bin will be aggregated into that bin. Everything else is ignored in the output dataset.
- Parameters:
from_selection (
BinSelection
) – from where the bins begin.from_end (bool) – use the right end of the bin if True
duration (str) – the bin size. Must be a string with a date duration (e.g. 1D, 1h, 1m, 1s)
stride (str) – the stride (step forward) between each the left edge of each bin. Must be a string with a date duration (e.g. 1D, 1h, 1m, 1s)
count (int) – how many bins to create
offset (str) – the offset from the first date to start the bins. Must be a string with a date duration (e.g. 1D, 1h, 1m, 1s)
See also
Attributes
count
(int) - how many bins
duration
(str) - the bin size, in time units for each bin
from_end
(bool) - use the right end of the bin if True
from_selection
(
BinSelection
, dict) - When to start the strided binning.offset
(str) - the offset from the first date to start the bins
stride
(str) - the stride (step forward), in time units between each bin
Methods
clear
()copy
()fromkeys
([value])Create a new dictionary with keys from iterable and values set to value.
get
(key[, default])Return the value for key if key is in the dictionary, else default.
items
()keys
()pop
(k[,d])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem
()Remove and return a (key, value) pair as a 2-tuple.
setdefault
(key[, default])Insert key with a value of default if key is not in the dictionary.
update
(*mapping, **kwargs)values
()