struct Crysda::DateTimeCol

Overview

=========================================================================== DateTime Column - stores Time values with optimized internal storage

Defined in:

crysda/columns.cr

Constant Summary

DATETIME_FORMATS = ["%Y-%m-%d %H:%M:%S", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%dT%H:%M:%SZ", "%Y-%m-%d %H:%M", "%Y-%m-%d", "%d/%m/%Y %H:%M:%S", "%d/%m/%Y", "%m/%d/%Y %H:%M:%S", "%m/%d/%Y", "%Y%m%d"]

Common date/time formats for parsing

Constructors

Instance Method Summary

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

def self.from_epoch(name : String, epochs : Array(Int64 | Nil)) : DateTimeCol #

Create from array of epoch seconds


[View source]
def self.new(name : String, val : Array(Time | Nil)) #

[View source]
def self.parse(name : String, strings : Array(String | Nil), format : String | Nil = nil) : DateTimeCol #

Parse strings to DateTime using common formats


[View source]

Instance Method Detail

def <(val : Time) #

[View source]
def <=(val : Time) #

[View source]
def ==(val : Time) #

[View source]
def >(val : Time) #

[View source]
def >=(val : Time) #

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

[View source]
def day : Int32Col #

Extract day component (1-31)


[View source]
def day_of_week : Int32Col #

Extract day of week (0=Sunday, 6=Saturday)


[View source]
def day_of_year : Int32Col #

Extract day of year (1-366)


[View source]
def each(&) : Nil #

Lazy iteration


[View source]
def each_non_null(&) : Nil #

[View source]
def each_with_index(&) : Nil #

[View source]
def has_nulls? : Bool #

[View source]
def hour : Int32Col #

Extract hour component (0-23)


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

Get max datetime


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

Get min datetime


[View source]
def minute : Int32Col #

Extract minute component (0-59)


[View source]
def month : Int32Col #

Extract month component (1-12)


[View source]
def second : Int32Col #

Extract second component (0-59)


[View source]
def strftime(format : String) : StringCol #

Format as strings


[View source]
def unsafe_fetch(index : Int32) : Time | Nil #

[View source]
def values : Array(Time | Nil) #

[View source]
def year : Int32Col #

Extract year component


[View source]