abstract struct Crysda::DataCol

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 apply(&block : Any -> Any) : DataCol #

Apply a function to each non-null value


[View source]
def as_b #

[View source]
def as_f64 #

[View source]
def as_i #

[View source]
def as_i64 #

[View source]
def as_s #

[View source]
def between(min_val, max_val) : Array(Bool) #

Check if numeric values are between min and max (inclusive)


[View source]
def bfill : DataCol #

Backward fill nulls (propagate next valid value)


[View source]
def clip(min_val, max_val) : DataCol #

Clip values to a range


[View source]
def clip_lower(min_val) : DataCol #

Clip values to minimum


[View source]
def clip_upper(max_val) : DataCol #

Clip values to maximum


[View source]
def coalesce(other : DataCol) : DataCol #

Column-level coalesce - return first non-null from self or other


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

[View source]
def cumsum #

[View source]
def cut(bins : Array(Number), labels : Array(String) | Nil = nil, right : Bool = true) : StringCol #

Bin values into discrete intervals (like pandas cut) bins: Array of bin edges (must be sorted ascending) labels: Optional labels for each bin (size must be bins.size - 1) right: If true (default), bins are (left, right], otherwise [left, right)


[View source]
def desc #

[View source]
def div(val) #

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

[View source]
def ffill : DataCol #

Forward fill nulls (propagate last valid value)


[View source]
def first : Any #

Get first non-null value from column


[View source]
def has_nulls? #

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

See Object#hash(hasher)


def in?(set : Array) : Array(Bool) #

Check if values are in a given set


[View source]
def is_in(set : Array) : Array(Bool) #

Check if values are in a given set (alias)


[View source]
def is_na #

[View source]
def is_not_na #

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

[View source]
def last : Any #

Get last non-null value from column


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

[View source]
def map(&) #

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

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

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

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

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

[View source]
def minus(val) #

[View source]
def name : String #

[View source]
def nunique : Int32 #

Count of unique values


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

[View source]
def pct_change : DataCol #

[View source]
def plus(val) #

[View source]
def qcut(q : Int32, labels : Array(String) | Nil = nil) : StringCol #

Quantile-based binning (like pandas qcut) q: Number of quantiles (e.g., 4 for quartiles, 10 for deciles) labels: Optional labels for each bin


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

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

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

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

[View source]
def str_contains(pattern : String | Regex, case_sensitive : Bool = true) : Array(Bool) #

Check if strings contain a pattern


[View source]
def str_downcase : StringCol #

Convert strings to lowercase


[View source]
def str_ends_with(suffix : String, case_sensitive : Bool = true) : Array(Bool) #

Check if strings end with suffix


[View source]
def str_extract(pattern : Regex) : StringCol #

Extract regex pattern from strings


[View source]
def str_len : Int32Col #

Get string lengths


[View source]
def str_replace(pattern : String | Regex, replacement : String) : StringCol #

Replace pattern in strings


[View source]
def str_slice(start : Int32, length : Int32 | Nil = nil) : StringCol #

Substring extraction


[View source]
def str_starts_with(prefix : String, case_sensitive : Bool = true) : Array(Bool) #

Check if strings start with prefix


[View source]
def str_strip : StringCol #

Strip whitespace from strings


[View source]
def str_upcase : StringCol #

Convert strings to uppercase


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

[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]
def unique : Array #

Get unique values in the column


[View source]
abstract def values : Array #

[View source]