Liking cljdoc? Tell your friends :D

tablecloth.time.utils.binary-search


ensure-time-columnclj

(ensure-time-column ds
                    time-col
                    {:keys [sorted? sort?] :or {sorted? false sort? true}})

Common helper for ds-level time operations.

Given a dataset ds and a time-col keyword/name, this function:

  1. Ensures the column exists in the dataset.
  2. Optionally checks sortedness and sorts by time-col if needed.

Options map:

  • :sorted? boolean, default false. If true, skip the sortedness check.
  • :sort? boolean, default true. If true and the column is not sorted, the dataset is sorted by time-col (ascending) before use.

Returns a map {:ds ds' :time-col time-col :time-col-series col}, where

  • ds' is either the original ds or a sorted copy,
  • time-col-series is the (possibly reordered) column from ds'.

This fn does not change the column's representation (no millis conversion). Representation conversion should be done explicitly by callers when needed.

Common helper for ds-level time operations.

Given a dataset `ds` and a `time-col` keyword/name, this function:

1. Ensures the column exists in the dataset.
2. Optionally checks sortedness and sorts by `time-col` if needed.

Options map:
- :sorted?   boolean, default false. If true, skip the sortedness check.
- :sort?     boolean, default true. If true and the column is not sorted,
             the dataset is sorted by `time-col` (ascending) before use.

Returns a map {:ds ds' :time-col time-col :time-col-series col}, where
- ds' is either the original ds or a sorted copy,
- time-col-series is the (possibly reordered) column from ds'.

This fn does *not* change the column's representation (no millis conversion).
Representation conversion should be done explicitly by callers when needed.
sourceraw docstring

find-lower-boundclj

(find-lower-bound arr target)
source

find-upper-boundclj

(find-upper-bound arr target)
source

is-sorted?clj

(is-sorted? col)
(is-sorted? col direction)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close