tables::column

template <is_primitive_type P>
class column;

Container of contiguously stored elements of primitive-type P. Supports column-oriented operations.

Member types

Member type Definition

prim_t

The primitive-type used by vector_t

vector_t

std::vector<prim_t>

column_t

The column type

column_impl_t

impl::column_impl<prim_t>

ptr_to_impl_t

std::shared_ptr<column_impl_t>

Member functions

Constructors

Member type Definition

Constructors

Constructos the table.

Assignment operator

Assigns values to the table.

Capacity

Member type Definition

size()

Returns number of elements in column

xre:column_n_nones.adoc[n_nones()]

Returns number of nones in column

Accessors

Member type Definition

v()

Returns underlying vector_t

impl()

Returns underlying column_impl_t

_v()

Returns underlying vector_t

_impl()

Returns underlying column_impl_t

Elements

Member type Definition

operator[]

Returns element at index i

at

Returns column with values copied from provided indices.

take

Returns column containing first n elements

drop

Returns column with first n elements dropped.

rtake

Returns column containing last n elements

rdrop

Returns column with last n elements dropped.

Append

Member type Definition

append

Returns column with element or column appended to the end.

_append

Appends element to column.

Transform

Member type Allowed primitive-types Definition

except

Any

Returns column containing all items except items in xs

apply

Any

Returns column with elements f(v(i))

cast_to

Any

Returns column with elements casted to P1

reverse

Any

Returns column with elements reversed

fills,fill_with,zfill

Any

Returns column with nones replaced with provided or existing value.

replace

Any

Returns column with elements replaced from provided column except for nones.

distinct

Any

Returns column with unique items in order of first occurrence.

differ

Any

Returns a column(bool_t) showing where consecutive items differ.

sort,rsort

Any

Returns column containing sorted items in ascending / descending order.

mins,maxs

Any

Returns column containing the cumulative minimums,maximums

mmin,mmax

Any

Returns column_t containing the moving minimum/maximum of the last m items.

next,prev

Any

Returns column_t containing next/prev items in the list.

deltas

Arithmetic

Returns column with differences of each item with its predecessor.

xbar

Arithmetic

Returns column containing elements rounded down to the nearest multiple of val

sums,msum

Arithmetic

Returns column_t containing the cumulative sum, or moving sums.

Aggregate

Member type Allowed primitive-types Definition

min,max

Any

Returns minimum/maximum element

all

Any

Returns true if all elements are true (for booleans) or non-zero (for other types)

any

Any

Returns true if any element is true (for booleans) or non-zero (for other types)

avg

Arithmetic

Returns the arithmetic mean.

dot

Arithmetic

Returns dot product.

norm

Arithmetic

Returns euclidean norm

Operations

Member type Allowed primitive-types Definition

starts_with,ends_with

std::string_view

Returns column-of-bools indicating if strings starts/ends with the given prefix/suffix.

substr

std::string_view

Returns column with given substrings.

concat

std::string_view

Return column with concatenation of strings.

to_string

std::string_view

Concatenates all strings into one string.

Others

Member type Allowed primitive-types Definition

cross

Any

Returns all possible combinations of two columns

Comparison

Member type Allowed primitive-types Definition

eq,ne

Any

Column-wise equality/inequality comparison.

lt,le

Any

Column-wise less-than/less-or-equal comparison.

gt,ge

Any

Column-wise greater-than/greater-or-equal comparison.

Non-member functions

Member type Allowed primitive-types Definition

operator<<

Any

Stream output

arithmetic operators

Arithmetic

Returns result of column-wise or column-scalar math operations.

comparison operators

Any

Returns result of column-wise or column-scalar comparisons.