Liking cljdoc? Tell your friends :D

tablecloth.time.column.api


coerce-columnclj

(coerce-column data)

Coerce data to a column.

Coerce data to a column.
sourceraw docstring

convert-timeclj

(convert-time col target)
(convert-time col target opts)

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.
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.
sourceraw docstring

dayclj

(day col)

Extract day of month from a datetime column.

Extract day of month from a datetime column.
sourceraw docstring

day-of-weekclj

(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).
sourceraw docstring

day-of-yearclj

(day-of-year col)

Extract day of year (1-366) from a datetime column.

Extract day of year (1-366) from a datetime column.
sourceraw docstring

down-to-nearestclj

(down-to-nearest col interval unit opts)

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.
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.
sourceraw docstring

epoch-dayclj

(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.
sourceraw docstring

epoch-weekclj

(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.
sourceraw docstring

floor-to-monthclj

(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.
sourceraw docstring

floor-to-quarterclj

(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.
sourceraw docstring

floor-to-yearclj

(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.
sourceraw docstring

get-secondclj

(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.
sourceraw docstring

hourclj

(hour col)

Extract hour from a datetime column.

Extract hour from a datetime column.
sourceraw docstring

lagclj

(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...]
sourceraw docstring

leadclj

(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]
sourceraw docstring

minuteclj

(minute col)

Extract minute from a datetime column.

Extract minute from a datetime column.
sourceraw docstring

monthclj

(month col)

Extract month (1-12) from a datetime column.

Extract month (1-12) from a datetime column.
sourceraw docstring

quarterclj

(quarter col)

Extract quarter (1-4) from a datetime column.

Extract quarter (1-4) from a datetime column.
sourceraw docstring

week-of-yearclj

(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.
sourceraw docstring

week-of-year-indexclj

(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.
sourceraw docstring

yearclj

(year col)

Extract year from a datetime column.

Extract year from a datetime column.
sourceraw docstring

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