pub struct Column { /* private fields */ }Expand description
A single named column with homogeneous type.
Implementations§
Source§impl Column
impl Column
Sourcepub fn new_bool(name: impl Into<String>, data: Vec<Option<bool>>) -> Self
pub fn new_bool(name: impl Into<String>, data: Vec<Option<bool>>) -> Self
Create a boolean column with nullable values.
Sourcepub fn new_i64(name: impl Into<String>, data: Vec<Option<i64>>) -> Self
pub fn new_i64(name: impl Into<String>, data: Vec<Option<i64>>) -> Self
Create an i64 column with nullable values.
Sourcepub fn new_u64(name: impl Into<String>, data: Vec<Option<u64>>) -> Self
pub fn new_u64(name: impl Into<String>, data: Vec<Option<u64>>) -> Self
Create a u64 column with nullable values.
Sourcepub fn new_f64(name: impl Into<String>, data: Vec<Option<f64>>) -> Self
pub fn new_f64(name: impl Into<String>, data: Vec<Option<f64>>) -> Self
Create an f64 column with nullable values.
Sourcepub fn new_string(name: impl Into<String>, data: Vec<Option<String>>) -> Self
pub fn new_string(name: impl Into<String>, data: Vec<Option<String>>) -> Self
Create a string column with nullable values.
Sourcepub fn from_bools(name: impl Into<String>, data: Vec<bool>) -> Self
pub fn from_bools(name: impl Into<String>, data: Vec<bool>) -> Self
Create a boolean column from non-nullable values.
Sourcepub fn from_i64s(name: impl Into<String>, data: Vec<i64>) -> Self
pub fn from_i64s(name: impl Into<String>, data: Vec<i64>) -> Self
Create an i64 column from non-nullable values.
Sourcepub fn from_u64s(name: impl Into<String>, data: Vec<u64>) -> Self
pub fn from_u64s(name: impl Into<String>, data: Vec<u64>) -> Self
Create a u64 column from non-nullable values.
Sourcepub fn from_f64s(name: impl Into<String>, data: Vec<f64>) -> Self
pub fn from_f64s(name: impl Into<String>, data: Vec<f64>) -> Self
Create an f64 column from non-nullable values.
Sourcepub fn from_strings(name: impl Into<String>, data: Vec<String>) -> Self
pub fn from_strings(name: impl Into<String>, data: Vec<String>) -> Self
Create a string column from owned strings (non-nullable).
Sourcepub fn from_strs(name: impl Into<String>, data: &[&str]) -> Self
pub fn from_strs(name: impl Into<String>, data: &[&str]) -> Self
Create a string column from string slices (non-nullable).
Sourcepub fn non_null_count(&self) -> usize
pub fn non_null_count(&self) -> usize
Count of non-null values.
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Count of null values.
Sourcepub fn data(&self) -> &ColumnData
pub fn data(&self) -> &ColumnData
Get the underlying data reference.
Sourcepub fn get(&self, index: usize) -> Option<Scalar>
pub fn get(&self, index: usize) -> Option<Scalar>
Get value at index as Scalar. Returns None if index out of bounds.
Sourcepub fn rename(&self, name: impl Into<String>) -> Self
pub fn rename(&self, name: impl Into<String>) -> Self
Rename this column (returns a new column).
Sourcepub fn take_optional(&self, indices: &[Option<usize>]) -> Self
pub fn take_optional(&self, indices: &[Option<usize>]) -> Self
Take rows at optional indices. None produces null values.
Used by join operations where one side may have no matching row.
Sourcepub fn as_str_iter(
&self,
) -> Result<impl Iterator<Item = Option<&str>>, DataFrameError>
pub fn as_str_iter( &self, ) -> Result<impl Iterator<Item = Option<&str>>, DataFrameError>
Iterate as string references. Returns Err if column is not Utf8.
Sourcepub fn as_i64_iter(
&self,
) -> Result<impl Iterator<Item = Option<i64>> + '_, DataFrameError>
pub fn as_i64_iter( &self, ) -> Result<impl Iterator<Item = Option<i64>> + '_, DataFrameError>
Iterate as i64 values. Returns Err if column is not Int64.
Sourcepub fn as_u64_iter(
&self,
) -> Result<impl Iterator<Item = Option<u64>> + '_, DataFrameError>
pub fn as_u64_iter( &self, ) -> Result<impl Iterator<Item = Option<u64>> + '_, DataFrameError>
Iterate as u64 values. Returns Err if column is not UInt64.
Sourcepub fn as_f64_iter(
&self,
) -> Result<impl Iterator<Item = Option<f64>> + '_, DataFrameError>
pub fn as_f64_iter( &self, ) -> Result<impl Iterator<Item = Option<f64>> + '_, DataFrameError>
Iterate as f64 values. Returns Err if column is not Float64.
Sourcepub fn as_bool_iter(
&self,
) -> Result<impl Iterator<Item = Option<bool>> + '_, DataFrameError>
pub fn as_bool_iter( &self, ) -> Result<impl Iterator<Item = Option<bool>> + '_, DataFrameError>
Iterate as bool values. Returns Err if column is not Bool.
Source§impl Column
impl Column
Sourcepub fn sum(&self) -> Scalar
pub fn sum(&self) -> Scalar
Sum of non-null numeric values. Returns Null for empty/non-numeric columns.
Sourcepub fn mean(&self) -> Scalar
pub fn mean(&self) -> Scalar
Mean of non-null numeric values. Returns Null if no non-null values.