pub enum Scalar {
Null(NullKind),
Bool(bool),
Int64(i64),
Float64(f64),
Utf8(String),
Timedelta64(i64),
Datetime64(i64),
Period(Period),
Interval(Interval),
}Variants§
Null(NullKind)
Bool(bool)
Int64(i64)
Float64(f64)
Utf8(String)
Timedelta64(i64)
Datetime64(i64)
Nanoseconds since Unix epoch. Matches pandas datetime64[ns].
Uses Timestamp::NAT (i64::MIN) for missing values.
Period(Period)
Period value (ordinal + frequency). A Period whose ordinal is
i64::MIN is NaT (missing). The frequency is carried so writers can
render the pandas calendar string (2024Q1, 2024-03, …) — the
calendar string is not recoverable from the ordinal alone, since
different frequencies share overlapping ordinal axes.
Interval(Interval)
Numeric interval value. Missing values remain Scalar::Null.
Implementations§
Source§impl Scalar
impl Scalar
pub fn dtype(&self) -> DType
pub fn is_missing(&self) -> bool
pub fn is_nan(&self) -> bool
Sourcepub const fn is_integer(&self) -> bool
pub const fn is_integer(&self) -> bool
Returns true if this is an Int64 scalar.
Sourcepub const fn is_numeric(&self) -> bool
pub const fn is_numeric(&self) -> bool
Returns true if this is a numeric scalar (Int64 or Float64).
Sourcepub const fn is_datetime(&self) -> bool
pub const fn is_datetime(&self) -> bool
Returns true if this is a Datetime64 scalar.
Sourcepub const fn is_timedelta(&self) -> bool
pub const fn is_timedelta(&self) -> bool
Returns true if this is a Timedelta64 scalar.
Sourcepub const fn is_interval(&self) -> bool
pub const fn is_interval(&self) -> bool
Returns true if this is an Interval scalar.
pub fn missing_for_dtype(dtype: DType) -> Self
pub fn semantic_eq(&self, other: &Self) -> bool
pub fn semantic_le(&self, other: &Self) -> bool
pub fn semantic_ge(&self, other: &Self) -> bool
pub fn is_null(&self) -> bool
pub fn is_na(&self) -> bool
pub fn coalesce(&self, other: &Self) -> Self
pub fn semantic_cmp(&self, other: &Self) -> Ordering
pub fn to_f64(&self) -> Result<f64, TypeError>
Sourcepub fn to_i64(&self) -> Result<i64, TypeError>
pub fn to_i64(&self) -> Result<i64, TypeError>
Try to convert to i64. Returns error for missing or non-numeric values.