(coerce-column data)Coerce data to a column.
Coerce data to a column.
(convert-time col target)(convert-time col target opts)Convert a time column between temporal and epoch representations.
opts map:
Convert a time column between temporal and epoch representations.
opts map:
- :zone — ZoneId or zone string used when a temporal representation needs
a zone (e.g. LocalDate/LocalDateTime/LocalTime or when producing
zoned types). Defaults to UTC when not provided.
(day col)Extract day of month from a datetime column.
Extract day of month from a datetime column.
(day-of-week col)Extract day of week from a datetime column. Monday=1, Sunday=7 (ISO standard).
Extract day of week from a datetime column. Monday=1, Sunday=7 (ISO standard).
(day-of-year col)Extract day of year (1-366) from a datetime column.
Extract day of year (1-366) from a datetime column.
(down-to-nearest col interval unit opts)Floor a col of time values to the nearest lower multiple of (interval × unit).
Arities:
Semantics:
Floor a `col` of time values to the nearest lower multiple of (interval × unit). Arities: - (down-to-nearest interval unit) => returns a function f; (f col) or (f x col) - (down-to-nearest col interval unit) - (down-to-nearest col interval unit opts) Semantics: - Converts x to epoch millis, floors by modulo (toward −∞), then converts back, preserving x's type (Instant/LocalDateTime/LocalDate/ZonedDateTime/OffsetDateTime). - If x is a number (millis), returns a number. - Units: :milliseconds :seconds :minutes :hours :days :weeks, and :months/:quarters/:years (calendar-aware). - LocalDate/LocalDateTime use the system default zone by default; pass opts with :zone to override.
(epoch-day col)Days since epoch (1970-01-01). Useful for continuous day numbering across years.
Days since epoch (1970-01-01). Useful for continuous day numbering across years.
(epoch-week col)Weeks since epoch (1970-01-01). Week 0 contains 1970-01-01. Useful for continuous week numbering across years.
Weeks since epoch (1970-01-01). Week 0 contains 1970-01-01. Useful for continuous week numbering across years.
(floor-to-month col interval)(floor-to-month col interval opts)Floor a temporal columns values the closest month interval.
Floor a temporal columns values the closest month interval.
(floor-to-quarter col interval)(floor-to-quarter col interval opts)Floor temporal column values to the closest quarter interval.
Floor temporal column values to the closest quarter interval.
(floor-to-year col interval)(floor-to-year col interval opts)Floor temporal column values to the closest year interval.
Floor temporal column values to the closest year interval.
(get-second col)Extract second from a datetime column.
Named get-second to avoid collision with clojure.core/second.
Extract second from a datetime column. Named `get-second` to avoid collision with clojure.core/second.
(hour col)Extract hour from a datetime column.
Extract hour from a datetime column.
(lag col k)Shift values forward by k positions, filling the first k positions with nil.
Returns a new column of the same type with nil at the start and the original values shifted forward. The nil values are properly tracked by tech.ml.dataset's missing value system.
Example: (lag [A B C D E] 2) ;; => [nil nil A B C] (lag col 4) ;; => [nil nil nil nil ...first n-4 values...]
Shift values forward by k positions, filling the first k positions with nil. Returns a new column of the same type with nil at the start and the original values shifted forward. The nil values are properly tracked by tech.ml.dataset's missing value system. Example: (lag [A B C D E] 2) ;; => [nil nil A B C] (lag col 4) ;; => [nil nil nil nil ...first n-4 values...]
(lead col k)Shift values backward by k positions, filling the last k positions with nil.
Returns a new column of the same type with nil at the end and the original values shifted backward.
Example: (lead [A B C D E] 2) ;; => [C D E nil nil] (lead col 4) ;; => [...values from index 4 onward... nil nil nil nil]
Shift values backward by k positions, filling the last k positions with nil. Returns a new column of the same type with nil at the end and the original values shifted backward. Example: (lead [A B C D E] 2) ;; => [C D E nil nil] (lead col 4) ;; => [...values from index 4 onward... nil nil nil nil]
(minute col)Extract minute from a datetime column.
Extract minute from a datetime column.
(month col)Extract month (1-12) from a datetime column.
Extract month (1-12) from a datetime column.
(quarter col)Extract quarter (1-4) from a datetime column.
Extract quarter (1-4) from a datetime column.
(week-of-year col)Extract ISO week of year (1-53) from a datetime column.
Extract ISO week of year (1-53) from a datetime column.
(week-of-year-index col)Week within year (0-52), computed as epoch-week minus epoch-week of Jan 1. Unlike ISO week-of-year, this avoids boundary issues where Jan 1 can be week 52/53. Useful for seasonal weekly plots.
Week within year (0-52), computed as epoch-week minus epoch-week of Jan 1. Unlike ISO week-of-year, this avoids boundary issues where Jan 1 can be week 52/53. Useful for seasonal weekly plots.
(year col)Extract year from a datetime column.
Extract year from a datetime column.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |