abstract struct Crysda::DataCol

Overview

Abstract base struct for column types of Int32?, Int64?, Float64?, Bool?, String?, DataFrame? or Any type

Direct Known Subclasses

Defined in:

crysda/columns.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String) #

[View source]

Instance Method Detail

def *(val : Number) #

[View source]
def *(val : DataCol) #

[View source]
def +(val : Number) #

[View source]
def +(val : DataCol) #

[View source]
def +(val : Iterable) #

[View source]
def +(val : String) #

[View source]
def -(val : Number) #

[View source]
def -(val : DataCol) #

[View source]
def - #

[View source]
def /(val : Number) #

[View source]
def /(val : DataCol) #

[View source]
def <(val : Any | DataCol) #

[View source]
def <=(val : Any | DataCol) #

[View source]
def ==(i : Any) #

[View source]
def ==(other : self) #

def >(val : Any | DataCol) #

[View source]
def >=(val : Any | DataCol) #

[View source]
def [](*args, **options) #

[View source]
def [](*args, **options, &) #

[View source]
def []?(*args, **options) #

[View source]
def []?(*args, **options, &) #

[View source]
def as_b #

Returns BoolCol values as an array of Bool?


[View source]
def as_f64 #

Returns Int32Col, Int64Col, Float64Col values as an array of Float64?


[View source]
def as_i #

Returns Int32Col values as an array of Int32?


[View source]
def as_i64 #

Returns Int32Col or Int64Col values as an array of Int64?


[View source]
def as_s #

Returns values as Array of String?


[View source]
abstract def compare(left : Int32, right : Int32, null_last = true) : Int32 #

[View source]
def cumsum #

Calculates the cumulative sum of the column values. An NA value in x causes the corresponding and following elements of the return value to be NA. raises InvalidColumnOperationException If the type of the column is not numeric


[View source]
def desc #

Creates a sorting attribute that inverts the order of the argument


[View source]
def div(val) #

[View source]
def equals(other : self) #

[View source]
def has_nulls? #

[View source]
def hash(hasher) #
Description copied from struct Struct

See Object#hash(hasher)


def is_na #

Maps a column to true for NA values and false otherwise Returns a Bool array with NA values marked as true, while others are marked as false


[View source]
def is_not_na #

Maps a column to false for NA values and true otherwise Returns a Bool array with NA values marked as false, while others are marked as true


[View source]
def lag(n = 1, default : Any = nil) #

Returns the "previous" column values. Useful for comparing values ahead of the current values. n - positive integer, giving the number of positions to lead by (defaults to 1)


[View source]
def lead(n = 1, default : Any = nil) #

Returns the "next" column values. Useful for comparing values ahead of the current values. n - positive integer, giving the number of positions to lead by (defaults to 1)


[View source]
def map(&) #

[View source]
def matching(missing_as = false, &) : Array(Bool) #

Match a text column in a NA-aware manner to create a predicate vector for filtering.


[View source]
def max(remove_na = false) #

Calculates the maximum of the column values. remove_na If true missing values will be excluded from the operation raises MissingValueException if remove_na is false but the data contains missing values raises InvalidColumnOperationException If the type of the column is not numeric


[View source]
def mean(remove_na = false) #

Calculates the arithmetic mean of the column values. remove_na If true missing values will be excluded from the operation raises MissingValueException if remove_na is false but the data contains missing values raises InvalidColumnOperationException If the type of the column is not numeric


[View source]
def median(remove_na = false) #

Calculates the median of the column values. remove_na If true missing values will be excluded from the operation raises MissingValueException if remove_na is false but the data contains missing values raises InvalidColumnOperationException If the type of the column is not numeric


[View source]
def min(remove_na = false) #

Calculates the minimum of the column values. remove_na If true missing values will be excluded from the operation raises MissingValueException if remove_na is false but the data contains missing values raises InvalidColumnOperationException If the type of the column is not numeric


[View source]
def minus(val) #

[View source]
def name : String #

[View source]
def order(na_last = true) #

#order returns the index each element would have in an ascending list

y = Float64Col.new("foo", [3.5, 3.0, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1])
y.order # => [8, 1, 3, 9, 2, 6, 7, 0, 4, 5]

[View source]
def pct_change : DataCol #

Calculates the percentage change between the current and a prior column value. raises InvalidColumnOperationException If the type of the receiver column is not numeric


[View source]
def plus(val) #

[View source]
def rank(na_last = true) #

#rank returns the order of each element in an ascending list

y = Float64Col.new("foo", [3.5, 3.0, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1])
y.rank # => [7, 1, 4, 2, 8, 9, 5, 6, 0, 3]

[View source]
def sd(remove_na = false) #

Calculates the standard deviation of the column values. remove_na If true missing values will be excluded from the operation raises MissingValueException if remove_na is false but the data contains missing values raises InvalidColumnOperationException If the type of the column is not numeric


[View source]
def size(*args, **options) #

[View source]
def size(*args, **options, &) #

[View source]
def sum(remove_na = false) #

Calculates the sum of the column values. remove_na If true missing values will be excluded from the operation raises MissingValueException if remove_na is false but the data contains missing values raises InvalidColumnOperationException If the type of the column is not numeric


[View source]
def times(val) #

[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]
abstract def values : Array #

[View source]