pub struct DataFrame {
pub constants: HashMap<Key, DataValue>,
pub dataframe: ColumnFrame,
pub metadata: HashMap<String, DataValue>,
}
Expand description
DataFrame holds information about ColumnFrame
.
This is used to store the data and the metadata for the candidates.
Fields§
§constants: HashMap<Key, DataValue>
Constants for the dataframe - mikro optimization for the data Values which is constant for the whole dataframe are stored here
dataframe: ColumnFrame
Dataframe with the candidates
metadata: HashMap<String, DataValue>
Metadata for the dataframe. Here you can store the information about the dataframe
Implementations§
Source§impl DataFrame
impl DataFrame
pub fn init() -> Self
pub fn keys(&self) -> Vec<String>
pub fn as_numpy_u32<'py>( &self, keys: Option<Vec<String>>, transposed: Option<bool>, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray2<u32>>>
pub fn as_numpy_u64<'py>( &self, keys: Option<Vec<String>>, transposed: Option<bool>, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray2<u64>>>
pub fn as_numpy_i32<'py>( &self, keys: Option<Vec<String>>, transposed: Option<bool>, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray2<i32>>>
pub fn as_numpy_i64<'py>( &self, keys: Option<Vec<String>>, transposed: Option<bool>, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray2<i64>>>
pub fn as_numpy_f32<'py>( &self, keys: Option<Vec<String>>, transposed: Option<bool>, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray2<f32>>>
pub fn as_numpy_f64<'py>( &self, keys: Option<Vec<String>>, transposed: Option<bool>, py: Python<'py>, ) -> PyResult<Bound<'py, PyArray2<f64>>>
pub fn py_shrink(&mut self)
pub fn py_add_metadata(&mut self, key: String, value: DataValue)
pub fn py_get_metadata(&self, key: &str) -> Option<DataValue>
pub fn py_rename_key(&mut self, key: &str, new_name: &str) -> Result<(), PyErr>
pub fn py_add_alias(&mut self, key: &str, new_name: &str) -> Result<(), PyErr>
pub fn py_select<'py>( &self, py: Python<'py>, keys: Option<Vec<String>>, ) -> Result<Bound<'py, PyList>, PyErr>
pub fn py_select_transposed<'py>( &self, py: Python<'py>, keys: Option<Vec<String>>, ) -> Result<Bound<'py, PyList>, PyErr>
pub fn py_select_column<'py>( &self, py: Python<'py>, key: String, ) -> Result<Bound<'py, PyList>, PyErr>
pub fn py_join( &mut self, other: DataFrame, join_type: JoinRelation, ) -> Result<(), PyErr>
pub fn py_push(&mut self, data: HashMap<Key, DataValue>) -> Result<(), PyErr>
pub fn py_add_column( &mut self, key: Key, data: Vec<DataValue>, ) -> Result<(), PyErr>
pub fn add_constant( &mut self, key: Key, feature: DataValue, ) -> Result<(), PyErr>
pub fn __iadd__(&mut self, object: Bound<'_, PyAny>) -> Result<(), PyErr>
pub fn __isub__(&mut self, object: Bound<'_, PyAny>) -> Result<(), PyErr>
pub fn __imul__(&mut self, object: Bound<'_, PyAny>) -> Result<(), PyErr>
pub fn __itruediv__(&mut self, object: Bound<'_, PyAny>) -> Result<(), PyErr>
pub fn __len__(&mut self) -> Result<usize, PyErr>
Source§impl DataFrame
impl DataFrame
pub fn new<C: Into<ColumnFrame>>(dataframe: C) -> Self
pub fn shrink(&mut self)
pub fn add_metadata(&mut self, key: String, value: DataValue)
pub fn get_metadata(&self, key: &str) -> Option<&DataValue>
pub fn join( &mut self, other: Self, join_type: &JoinRelation, ) -> Result<(), Error>
pub fn apply_function<F>(&mut self, keys: &[Key], func: F) -> Result<(), Error>
pub fn select(&self, keys: Option<&[Key]>) -> Result<Array2<DataValue>, Error>
pub fn select_transposed_typed<D: Extract>(&self, keys: &[Key]) -> Vec<Vec<D>>
pub fn select_column(&self, key: Key) -> Option<ArrayView1<'_, DataValue>>
pub fn select_transposed( &self, keys: Option<&[Key]>, ) -> Result<Array2<DataValue>, Error>
pub fn insert_constant(&mut self, key: Key, value: DataValue)
pub fn push<C: CandidateData>(&mut self, item: C) -> Result<(), Error>
pub fn remove_column(&mut self, keys: &[Key]) -> Result<Self, Error>
pub fn extend(&mut self, items: Self) -> Result<(), Error>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn add_single_column<K: Into<Key>>( &mut self, key: K, values: Array1<DataValue>, ) -> Result<(), Error>
pub fn get_single_column(&self, key: &Key) -> Option<ArrayView1<'_, DataValue>>
pub fn sorted(&self, key: &Key) -> Result<SortedDataFrame<'_>, Error>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataFrame
impl<'de> Deserialize<'de> for DataFrame
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ColumnFrame> for DataFrame
impl From<ColumnFrame> for DataFrame
Source§fn from(dataframe: ColumnFrame) -> Self
fn from(dataframe: ColumnFrame) -> Self
Converts to this type from the input type.
Source§impl From<SizedHashMap<SmartString<LazyCompact>, Vec<DataValue>>> for DataFrame
impl From<SizedHashMap<SmartString<LazyCompact>, Vec<DataValue>>> for DataFrame
Source§impl<'py> IntoPyObject<'py> for DataFrame
impl<'py> IntoPyObject<'py> for DataFrame
Source§type Output = Bound<'py, <DataFrame as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <DataFrame as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl PyClassImpl for DataFrame
impl PyClassImpl for DataFrame
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§type ThreadChecker = SendablePyClass<DataFrame>
type ThreadChecker = SendablePyClass<DataFrame>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature<DataFrame> for PyClassImplCollector<DataFrame>
impl PyClassNewTextSignature<DataFrame> for PyClassImplCollector<DataFrame>
fn new_text_signature(self) -> Option<&'static str>
Source§impl PyMethods<DataFrame> for PyClassImplCollector<DataFrame>
impl PyMethods<DataFrame> for PyClassImplCollector<DataFrame>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for DataFrame
impl PyTypeInfo for DataFrame
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
Source§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::type_object
Deprecated name for
PyTypeInfo::type_object
.Source§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type or a subclass of this type.Source§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::is_type_of
Deprecated name for
PyTypeInfo::is_type_of
.Source§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object
is an instance of this type.Source§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
👎Deprecated since 0.23.0: renamed to
PyTypeInfo::is_exact_type_of
Deprecated name for
PyTypeInfo::is_exact_type_of
.impl DerefToPyAny for DataFrame
impl StructuralPartialEq for DataFrame
Auto Trait Implementations§
impl Freeze for DataFrame
impl RefUnwindSafe for DataFrame
impl Send for DataFrame
impl Sync for DataFrame
impl Unpin for DataFrame
impl UnwindSafe for DataFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
Source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self
into an owned Python object, dropping type information.