Struct blackjack::dataframe::DataFrame [−][src]
pub struct DataFrame { /* fields omitted */ }
Struct for holding Series
or [SeriesTrait
] like objects.
as well as adding some additional functionality by grouping them.
Methods
impl DataFrame
[src]
impl DataFrame
pub fn new() -> Self
[src]
pub fn new() -> Self
pub fn read_csv<S: AsRef<OsStr> + ToString>(
path: S,
delimiter: u8
) -> Result<Self, Box<Error>>
[src]
pub fn read_csv<S: AsRef<OsStr> + ToString>(
path: S,
delimiter: u8
) -> Result<Self, Box<Error>>
Read a CSV file into a DataFrame
where each column represents a Series
supports automatic decompression of gzipped files if they end with .gz
Example
use blackjack::prelude::*; let path = format!("{}/tests/data/basic_csv.csv.gz", env!("CARGO_MANIFEST_DIR")); let df = DataFrame::read_csv(&path, b',').unwrap(); assert_eq!(df["col1"].sum::<i32>(), 15);
Trait Implementations
impl Default for DataFrame
[src]
impl Default for DataFrame
impl Debug for DataFrame
[src]
impl Debug for DataFrame
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for DataFrame
[src]
impl Display for DataFrame
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl DataFrameBehavior for DataFrame
[src]
impl DataFrameBehavior for DataFrame
fn into_raw(self) -> *mut Self
[src]
fn into_raw(self) -> *mut Self
Transform into a raw pointer
fn from_raw(ptr: *mut Self) -> Self
[src]
fn from_raw(ptr: *mut Self) -> Self
Get a DataFrame from raw pointer
impl ColumnManager for DataFrame
[src]
impl ColumnManager for DataFrame
fn add_column(&mut self, series: Series)
[src]
fn add_column(&mut self, series: Series)
Add a new series to the dataframe as a column.
fn get_column(&self, name: &str) -> Option<&Series>
[src]
fn get_column(&self, name: &str) -> Option<&Series>
Get a reference to a series by name, will also have to know the primitive type stored. Read more
fn get_column_mut(&mut self, name: &str) -> Option<&mut Series>
[src]
fn get_column_mut(&mut self, name: &str) -> Option<&mut Series>
Same as ColumnManager::get_column
but as a mut
reference.
fn n_columns(&self) -> usize
[src]
fn n_columns(&self) -> usize
Get the number of columns
fn columns(&self) -> HashSet<&String>
[src]
fn columns(&self) -> HashSet<&String>
Return the current dataframe's columns
impl<S: Into<String>> Index<S> for DataFrame
[src]
impl<S: Into<String>> Index<S> for DataFrame
type Output = Series
The returned type after indexing.
fn index(&self, name: S) -> &Series
[src]
fn index(&self, name: S) -> &Series
Performs the indexing (container[index]
) operation.
impl<S: Into<String>> IndexMut<S> for DataFrame
[src]
impl<S: Into<String>> IndexMut<S> for DataFrame