struct
Crysda::StringCol
- Crysda::StringCol
- Crysda::DataCol
- Struct
- Value
- Object
Overview
=========================================================================== String Column
Defined in:
crysda/columns.crConstructors
-
.interned(name : String, data : Array(String), bitmap : NullBitmap) : StringCol
Create from raw data with interning
-
.interned(name : String, val : Array(String | Nil)) : StringCol
Create StringCol with string interning for categorical data
- .new(name : String, val : Array(String | Nil))
Instance Method Summary
- #<(val : String)
- #<(val : StringCol)
- #<=(val : String)
- #<=(val : StringCol)
- #>(val : String)
- #>(val : StringCol)
- #>=(val : String)
- #>=(val : StringCol)
-
#categorical?(threshold : Float64 = 0.5) : Bool
Check if this column is categorical (low cardinality)
- #compare(left : Int32, right : Int32, null_last = true) : Int32
-
#contains(pattern : String, case_sensitive : Bool = true) : Array(Bool)
Check if strings contain a pattern (string or regex)
-
#contains(pattern : Regex) : Array(Bool)
Check if strings contain a regex pattern
-
#count(pattern : String) : Int32Col
Count occurrences of pattern in each string
-
#downcase : StringCol
Convert to lowercase
-
#each(&) : Nil
Lazy iteration - yields values without materializing full array
-
#each_non_null(&) : Nil
Lazy iteration over non-null values only (fast path)
-
#each_with_index(&) : Nil
Lazy iteration with index
-
#ends_with(suffix : String, case_sensitive : Bool = true) : Array(Bool)
Check if strings end with suffix
-
#extract(pattern : Regex) : StringCol
Extract first match of regex pattern, returns StringCol If regex has capture groups, returns the first capture group
- #has_nulls? : Bool
-
#len : Int32Col
Get string length
-
#lstrip : StringCol
Strip whitespace from left
-
#matches(pattern : Regex) : Array(Bool)
Check if strings match regex exactly
-
#pad_left(width : Int32, pad_char : Char = ' ') : StringCol
Pad string to specified width (left pad)
-
#pad_right(width : Int32, pad_char : Char = ' ') : StringCol
Pad string to specified width (right pad)
- #plus(val : DataCol)
-
#replace(pattern : String, replacement : String) : StringCol
Replace pattern with replacement string
-
#replace(pattern : Regex, replacement : String) : StringCol
Replace regex pattern with replacement string
-
#rstrip : StringCol
Strip whitespace from right
-
#slice(start : Int32, length : Int32 | Nil = nil) : StringCol
Substring extraction
-
#starts_with(prefix : String, case_sensitive : Bool = true) : Array(Bool)
Check if strings start with prefix
-
#strip : StringCol
Strip whitespace from both ends
-
#unique_count : Int32
Get unique values count (useful for determining if interning is beneficial)
-
#unsafe_fetch(index : Int32) : String | Nil
Direct index access without array materialization
-
#upcase : StringCol
Convert to uppercase
- #values : Array(String | Nil)
Instance methods inherited from struct Crysda::DataCol
*(val : Number)*(val : DataCol) *, +(val : Number)
+(val : DataCol)
+(val : Iterable)
+(val : String) +, -(val : Number)
-(val : DataCol)
- -, /(val : Number)
/(val : DataCol) /, <(val : Any | DataCol) <, <=(val : Any | DataCol) <=, ==(i : Any)
==(other : self) ==, >(val : Any | DataCol) >, >=(val : Any | DataCol) >=, [](*args, **options)
[](*args, **options, &) [], []?(*args, **options)
[]?(*args, **options, &) []?, apply(&block : Any -> Any) : DataCol apply, as_b as_b, as_f64 as_f64, as_i as_i, as_i64 as_i64, as_s as_s, between(min_val, max_val) : Array(Bool) between, bfill : DataCol bfill, clip(min_val, max_val) : DataCol clip, clip_lower(min_val) : DataCol clip_lower, clip_upper(max_val) : DataCol clip_upper, coalesce(other : DataCol) : DataCol coalesce, compare(left : Int32, right : Int32, null_last = true) : Int32 compare, cumsum cumsum, cut(bins : Array(Number), labels : Array(String) | Nil = nil, right : Bool = true) : StringCol cut, desc desc, div(val) div, equals(other : self) equals, ffill : DataCol ffill, first : Any first, has_nulls? has_nulls?, hash(hasher) hash, in?(set : Array) : Array(Bool) in?, is_in(set : Array) : Array(Bool) is_in, is_na is_na, is_not_na is_not_na, lag(n = 1, default : Any = nil) lag, last : Any last, lead(n = 1, default : Any = nil) lead, map(&) map, matching(missing_as = false, &) : Array(Bool) matching, max(remove_na = false) max, mean(remove_na = false) mean, median(remove_na = false) median, min(remove_na = false) min, minus(val) minus, name : String name, nunique : Int32 nunique, order(na_last = true) order, pct_change : DataCol pct_change, plus(val) plus, qcut(q : Int32, labels : Array(String) | Nil = nil) : StringCol qcut, rank(na_last = true) rank, sd(remove_na = false) sd, size(*args, **options)
size(*args, **options, &) size, str_contains(pattern : String | Regex, case_sensitive : Bool = true) : Array(Bool) str_contains, str_downcase : StringCol str_downcase, str_ends_with(suffix : String, case_sensitive : Bool = true) : Array(Bool) str_ends_with, str_extract(pattern : Regex) : StringCol str_extract, str_len : Int32Col str_len, str_replace(pattern : String | Regex, replacement : String) : StringCol str_replace, str_slice(start : Int32, length : Int32 | Nil = nil) : StringCol str_slice, str_starts_with(prefix : String, case_sensitive : Bool = true) : Array(Bool) str_starts_with, str_strip : StringCol str_strip, str_upcase : StringCol str_upcase, sum(remove_na = false) sum, times(val) times, to_s(io : IO) : Nil
to_s to_s, unique : Array unique, values : Array values
Constructor methods inherited from struct Crysda::DataCol
new(name : String)
new
Constructor Detail
Create from raw data with interning
Create StringCol with string interning for categorical data
Instance Method Detail
Check if this column is categorical (low cardinality)
Check if strings contain a pattern (string or regex)
Check if strings end with suffix
Extract first match of regex pattern, returns StringCol If regex has capture groups, returns the first capture group
Pad string to specified width (left pad)
Pad string to specified width (right pad)
Replace pattern with replacement string
Replace regex pattern with replacement string
Substring extraction
Check if strings start with prefix
Get unique values count (useful for determining if interning is beneficial)