mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-21 03:49:59 +00:00
Merge 57ed06f79b7c5c77477fbcadb064370a203de6de into 6e0ea441e40395ce5e8fe5a1b22d7829a0adb583
This commit is contained in:
commit
e5dff3eee3
1024
src/dataframe/df.rs
Normal file
1024
src/dataframe/df.rs
Normal file
File diff suppressed because it is too large
Load Diff
2
src/dataframe/mod.rs
Normal file
2
src/dataframe/mod.rs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
//! This module provides the DataFrame structure for handling tabular data with mixed types.
|
||||||
|
pub mod df;
|
@ -316,7 +316,7 @@ impl<T: Clone + PartialEq> Frame<T> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an immutable slice of the specified column's data.
|
/// Returns an immutable slice of the specified column's data by name.
|
||||||
/// Panics if the column name is not found.
|
/// Panics if the column name is not found.
|
||||||
pub fn column(&self, name: &str) -> &[T] {
|
pub fn column(&self, name: &str) -> &[T] {
|
||||||
let idx = self
|
let idx = self
|
||||||
@ -325,7 +325,13 @@ impl<T: Clone + PartialEq> Frame<T> {
|
|||||||
self.matrix.column(idx)
|
self.matrix.column(idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a mutable slice of the specified column's data.
|
/// Returns an immutable slice of the specified column's data by its physical index.
|
||||||
|
/// Panics if the index is out of bounds.
|
||||||
|
pub fn column_by_physical_idx(&self, idx: usize) -> &[T] {
|
||||||
|
self.matrix.column(idx)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a mutable slice of the specified column's data by name.
|
||||||
/// Panics if the column name is not found.
|
/// Panics if the column name is not found.
|
||||||
pub fn column_mut(&mut self, name: &str) -> &mut [T] {
|
pub fn column_mut(&mut self, name: &str) -> &mut [T] {
|
||||||
let idx = self
|
let idx = self
|
||||||
@ -334,6 +340,12 @@ impl<T: Clone + PartialEq> Frame<T> {
|
|||||||
self.matrix.column_mut(idx)
|
self.matrix.column_mut(idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns a mutable slice of the specified column's data by its physical index.
|
||||||
|
/// Panics if the index is out of bounds.
|
||||||
|
pub fn column_mut_by_physical_idx(&mut self, idx: usize) -> &mut [T] {
|
||||||
|
self.matrix.column_mut(idx)
|
||||||
|
}
|
||||||
|
|
||||||
// Row access methods
|
// Row access methods
|
||||||
|
|
||||||
/// Returns an immutable view of the row for the given integer key.
|
/// Returns an immutable view of the row for the given integer key.
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
|
/// Documentation for the [`crate::dataframe`] module.
|
||||||
|
pub mod dataframe;
|
||||||
|
|
||||||
/// Documentation for the [`crate::matrix`] module.
|
/// Documentation for the [`crate::matrix`] module.
|
||||||
pub mod matrix;
|
pub mod matrix;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user