(column)
(column data)
(column data {:keys [name] :as options})
Create a column
from a vector or sequence.
Create a `column` from a vector or sequence.
(column-map col map-fn)
(column-map col map-fn options)
Applies a map function map-fn
to one or more columns. If col
is
a vector of columns, map-fn
must have an arity equal to the number
of columns. The datatype of the resulting column will be inferred,
unless specified in the options
map. Missing values can be handled
by providing a :missing-fn
in the options map.
options:
Applies a map function `map-fn` to one or more columns. If `col` is a vector of columns, `map-fn` must have an arity equal to the number of columns. The datatype of the resulting column will be inferred, unless specified in the `options` map. Missing values can be handled by providing a `:missing-fn` in the options map. options: - :datatype - The desired datatype of the resulting column. The datatype is inferred if not provided - :missing-fn - A function that takes a sequence of columns, and returns a set of missing index positions.
(column? item)
Return true or false item
is a column.
Return true or false `item` is a column.
(ones n-ones)
Creates a new column filled with n-ones
Creates a new column filled with `n-ones`
(slice col from)
(slice col from to)
(slice col from to step)
Returns a subset of the column defined by the inclusive from
and
to
indexes. If to
is not provided, slices to the end of the
column. If from
is not provided (i.e. is nil
), slices from the
beginning of the column. If either from
or to
is a negative
number, it is treated as an index from the end of the column. The
:start
and :end
keywords can be used to represent the start and
end of the column, respectively.
Examples: (def column [1 2 3 4 5]) (slice column 1 3) ;=> [2 3] (slice column 2) ;=> [3 4 5] (slice column -3 -1) ;=> [3 4 5] (slice column :start 2) ;=> [1 2 3 4 5] (slice column 2 :end) ;=> [3 4 5] (slice column -2 :end) ;=> [4 5]
Returns a subset of the column defined by the inclusive `from` and `to` indexes. If `to` is not provided, slices to the end of the column. If `from` is not provided (i.e. is `nil`), slices from the beginning of the column. If either `from` or `to` is a negative number, it is treated as an index from the end of the column. The `:start` and `:end` keywords can be used to represent the start and end of the column, respectively. Examples: (def column [1 2 3 4 5]) (slice column 1 3) ;=> [2 3] (slice column 2) ;=> [3 4 5] (slice column -3 -1) ;=> [3 4 5] (slice column :start 2) ;=> [1 2 3 4 5] (slice column 2 :end) ;=> [3 4 5] (slice column -2 :end) ;=> [4 5]
(sort-column col)
(sort-column col order-or-comparator)
Returns a sorted version of the column col
. You can supply the ordering
keywords :asc
or :desc
or a comparator function to order-or-comparator
.
If no comparator function is provided, the column will be sorted in
ascending order.
Returns a sorted version of the column `col`. You can supply the ordering keywords `:asc` or `:desc` or a comparator function to `order-or-comparator`. If no comparator function is provided, the column will be sorted in ascending order.
(typeof col)
Returns the concrete type of the elements within the column col
.
Returns the concrete type of the elements within the column `col`.
(typeof? col datatype)
True|false the column's elements are of the provided type datatype
. Can check
both concrete types (e.g. :int32) or general types (:numerical, :textual, etc).
True|false the column's elements are of the provided type `datatype`. Can check both concrete types (e.g. :int32) or general types (:numerical, :textual, etc).
(zeros n-zeros)
Create a new column filled wth n-zeros
.
Create a new column filled wth `n-zeros`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close