clojure.core.matrix.dataset

Namespace for the core.matrix dataset API. Datasets are similar to 2D matrices, except that they support labelled
columns and operations on labelled columns.

add-column

(add-column ds col-name col)
Adds column to the dataset.

column-name

(column-name ds idx)
Returns column name at given index. Returns nil if index is not found.

column-names

(column-names ds)
Returns a persistent vector containing column names in the same order as they are placed in the dataset.

dataset

(dataset col-names data)(dataset data)
Creates dataset from on of the following:
1. matrix - its columns will be used as dataset columns.
2. seq of rows
3. seq of row maps (column names -> values for each row)
4. map of columns with associated list of values.
5. seq of maps

If col-names are provided they will be used, else incrementing Long values starting from 0, 
i.e. 0, 1, 2, etc will be used as column names

dataset?

macro

(dataset? d)
Returns true if argument is a dataset.

dimension-name

(dimension-name ds dim idx)
Returns the name for a given index along the specified dimension.

except-columns

(except-columns ds col-names)
Returns new dataset with all columns except specified.

join-columns

(join-columns ds1 ds2)(join-columns ds1 ds2 & args)
Returns a dataset created by combining the columns of the given datasets

join-rows

(join-rows ds1 ds2)(join-rows ds1 ds2 & args)
Returns a dataset created by combining the rows of the given datasets

merge-datasets

(merge-datasets ds1 ds2)(merge-datasets ds1 ds2 & args)
Returns a dataset created by combining columns of the given datasets. In case of columns with duplicate names, last-one-wins strategy is applied.

rename-columns

(rename-columns ds col-map)
Renames columns based on map of old column name -> new column name pairs

replace-column

(replace-column ds col-name vs)
Replaces column in a dataset with new values

row-maps

(row-maps ds)
Returns vector of maps with row values.

select-columns

(select-columns ds col-names)
Produces a new dataset with the columns in the specified order.

select-rows

(select-rows ds rows)
Produces a new dataset with the rows in the specified order.

to-map

(to-map ds)
Returns map of columns with associated list of values.

update-column

(update-column ds col-name f & args)
Applies function f to column in a dataset