struct

Crysda::DataCol

Inherits Struct < Value < Object

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

Constructors

new(name : String)
Source

Instance methods

*(val : Number)
Source
*(val : DataCol)
Source
+(val : Number)
Source
+(val : DataCol)
Source
+(val : String)
Source
-(val : Number)
Source
-(val : DataCol)
Source
/(val : Number)
Source
/(val : DataCol)
Source
<(val : Any | DataCol)
Source
<=(val : Any | DataCol)
Source
==(i : Any)
Source
==(other : self)
>(val : Any | DataCol)
Source
>=(val : Any | DataCol)
Source
[](*args, **options)
Source
[](*args, **options, &)
Source
[]?(*args, **options)
Source
[]?(*args, **options, &)
Source
as_b

Returns BoolCol values as an array of Bool?

Source
as_f64

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

Source
as_i

Returns Int32Col values as an array of Int32?

Source
as_i64

Returns Int32Col or Int64Col values as an array of Int64?

Source
as_s

Returns values as Array of String?

Source
compare(left : Int32, right : Int32, null_last = true) : Int32
Source
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

Source
desc

Creates a sorting attribute that inverts the order of the argument

Source
div(val)
Source
equals(other : self)
Source
has_nulls?
Source
hash(hasher)

See Object#hash(hasher)

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

Source
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

Source
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)

Source
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)

Source
matching(missing_as = false, &) : Array(Bool)

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

Source
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

Source
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

Source
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

Source
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

Source
minus(val)
Source
name
Source
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]
Source
pct_change

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

Source
plus(val)
Source
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]
Source
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

Source
size(*args, **options)
Source
size(*args, **options, &)
Source
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

Source
times(val)
Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
to_s

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.

Source
values
Source