pub enum NumpyNumeric {
Bool,
Int(u8),
UInt(u8),
Float(u8),
}Expand description
A numeric column’s numpy dtype as numpy’s promotion sees it: kind and
bits. The 64-bit ones are a column without a NumericWidth.
Variants§
Implementations§
Source§impl NumpyNumeric
impl NumpyNumeric
Sourcepub const fn of(dtype: &DType, width: Option<NumericWidth>) -> Option<Self>
pub const fn of(dtype: &DType, width: Option<NumericWidth>) -> Option<Self>
The numpy dtype of a column of dtype carrying width; None for a
column that is not bool, integer or float (or a width its storage
cannot carry).
pub const fn of_width(width: NumericWidth) -> Self
Sourcepub const fn width(self) -> Option<NumericWidth>
pub const fn width(self) -> Option<NumericWidth>
The width a column of this numpy dtype carries: None for bool,
int64 and float64.
pub const fn is_float(self) -> bool
Sourcepub const fn result_type(self, other: Self) -> Self
pub const fn result_type(self, other: Self) -> Self
numpy’s result_type of two arrays: the smallest dtype holding both
(bool yields to anything; int8 + uint8 is int16, int64 + uint64
float64; float32 holds integers of up to 16 bits, a wider integer
makes it float64).
Sourcepub const fn with_python_int(self) -> Self
pub const fn with_python_int(self) -> Self
The dtype of this array combined with a Python int (NEP 50: the
Python scalar is weak, the array’s dtype wins; bool becomes int64).
Whether the int fits that dtype is the caller’s check.
Sourcepub const fn with_python_float(self) -> Self
pub const fn with_python_float(self) -> Self
The dtype of this array combined with a Python float: a float
array keeps its dtype (float32 + 0.2 is float32), anything else is
float64.