abstract struct Crysda::DataCol
- Crysda::DataCol
- Struct
- Value
- Object
Overview
Abstract base struct for column types of Int32?, Int64?, Float64?, Bool?, String?, DataFrame? or Any type
Direct Known Subclasses
- Crysda::AnyCol
- Crysda::BoolCol
- Crysda::DFCol
- Crysda::Float64Col
- Crysda::Int32Col
- Crysda::Int64Col
- Crysda::StringCol
Defined in:
crysda/columns.crConstructors
Instance Method Summary
- #*(val : DataCol)
- #*(val : Number)
- #+(val : Number)
- #+(val : DataCol)
- #+(val : Iterable)
- #+(val : String)
- #-(val : Number)
- #-(val : DataCol)
- #-
- #/(val : DataCol)
- #/(val : Number)
- #<(val : Any | DataCol)
- #<=(val : Any | DataCol)
- #==(i : Any)
- #==(other : self)
- #>(val : Any | DataCol)
- #>=(val : Any | DataCol)
- #[](*args, **options)
- #[](*args, **options, &)
- #[]?(*args, **options, &)
- #[]?(*args, **options)
-
#as_b
Returns
BoolCol
values as an array ofBool?
-
#as_f64
Returns
Int32Col, Int64Col, Float64Col
values as an array ofFloat64?
-
#as_i
Returns
Int32Col
values as an array ofInt32?
- #as_i64
-
#as_s
Returns values as Array of String?
- #compare(left : Int32, right : Int32, null_last = true) : Int32
-
#cumsum
Calculates the cumulative sum of the column values.
-
#desc
Creates a sorting attribute that inverts the order of the argument
- #div(val)
- #equals(other : self)
- #has_nulls?
-
#hash(hasher)
See
Object#hash(hasher)
-
#is_na
Maps a column to true for NA values and
false
otherwise Returns aBool
array with NA values marked as true, while others are marked as false -
#is_not_na
Maps a column to false for NA values and
true
otherwise Returns aBool
array with NA values marked as false, while others are marked as true -
#lag(n = 1, default : Any = nil)
Returns the "previous" column values.
-
#lead(n = 1, default : Any = nil)
Returns the "next" column values.
- #map(&)
-
#matching(missing_as = false, &) : Array(Bool)
Match a text column in a NA-aware manner to create a predicate vector for filtering.
-
#max(remove_na = false)
Calculates the maximum of the column values.
-
#mean(remove_na = false)
Calculates the arithmetic mean of the column values.
-
#median(remove_na = false)
Calculates the median of the column values.
-
#min(remove_na = false)
Calculates the minimum of the column values.
- #minus(val)
- #name : String
-
#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]
`
-
#pct_change : DataCol
Calculates the percentage change between the current and a prior column value.
- #plus(val)
-
#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]
`
-
#sd(remove_na = false)
Calculates the standard deviation of the column values.
- #size(*args, **options)
- #size(*args, **options, &)
-
#sum(remove_na = false)
Calculates the sum of the column values.
- #times(val)
-
#to_s(io : IO) : Nil
Same as
#inspect(io)
. -
#to_s
Returns a string representation of this object.
- #values : Array
Constructor Detail
Instance Method Detail
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
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
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
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)
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)
Match a text column in a NA-aware manner to create a predicate vector for filtering.
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
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
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
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
#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]
Calculates the percentage change between the current and a prior column value.
raises InvalidColumnOperationException
If the type of the receiver column is not numeric
#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]
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
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