pub struct DataFrame { /* private fields */ }
Expand description

The container for Series<T> objects, allowing for additional functionality

Implementations§

Create a new DataFrame struct

Example
use blackjack::prelude::*;

let mut df = DataFrame::new();

Length of the dataframe

Example
use blackjack::prelude::*;

let mut df = DataFrame::new();
assert_eq!(df.len(), None);

let series: Series<i32> = Series::arange(0, 10);
df.add_column(series).unwrap();

assert_eq!(df.len(), Some(10));

Quickly identify if the dataframe is empty.

Add a column to this dataframe.

Retrieves a column from the dataframe as an owned representation of it.

Get a list of column names in this dataframe as an iterator

Get the number of columns for this dataframe

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", env!("CARGO_MANIFEST_DIR"));
let df = DataFrame::read_csv(&path, b',').unwrap();

let col1: Series<f32> = df.get_column("col1").unwrap();
assert_eq!(col1.sum() as i32, 15);

Trait Implementations§

Group by method for grouping Series in a DataFrame by key. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.