mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-11-20 05:26:11 +00:00
Compare commits
7 Commits
v0.0.1-a.2
...
57ed06f79b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57ed06f79b | ||
|
|
01a132264f | ||
|
|
ff4535c56b | ||
| 9b480e8130 | |||
|
|
fe666a4ddb | ||
|
|
b80d5ab381 | ||
|
|
49f7558225 |
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.
|
||||
pub fn column(&self, name: &str) -> &[T] {
|
||||
let idx = self
|
||||
@@ -325,7 +325,13 @@ impl<T: Clone + PartialEq> Frame<T> {
|
||||
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.
|
||||
pub fn column_mut(&mut self, name: &str) -> &mut [T] {
|
||||
let idx = self
|
||||
@@ -334,6 +340,12 @@ impl<T: Clone + PartialEq> Frame<T> {
|
||||
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
|
||||
|
||||
/// Returns an immutable view of the row for the given integer key.
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#![doc = include_str!("../README.md")]
|
||||
|
||||
/// Documentation for the [`crate::dataframe`] module.
|
||||
pub mod dataframe;
|
||||
|
||||
/// Documentation for the [`crate::matrix`] module.
|
||||
pub mod matrix;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user