Struct utah::dataframe::DataFrame [] [src]

pub struct DataFrame<T> where
    T: UtahNum
{ pub columns: Vec<String>, pub data: Matrix<T>, pub index: Vec<String>, }

A read-only dataframe.

Fields

Trait Implementations

impl<T: Debug> Debug for DataFrame<T> where
    T: UtahNum
[src]

Formats the value using the given formatter.

impl<T: Clone> Clone for DataFrame<T> where
    T: UtahNum
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq for DataFrame<T> where
    T: UtahNum
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T> ReadCSV<T> for DataFrame<T> where
    T: UtahNum + Decodable
[src]

impl<'a, T> Constructor<'a, T> for DataFrame<T> where
    T: UtahNum + 'a, 
[src]

Create a new dataframe. The only required argument is data to populate the dataframe. By default, the columns and index of the dataframe are ["1", "2", "3"..."N"], where N is the number of columns (or rows) in the data.

use utah::prelude::*;
let a = arr2(&[[2.0, 7.0], [3.0, 4.0]]);
let df : DataFrame<f64> = DataFrame::new(a);

When populating the dataframe with mixed-types, wrap the elements with InnerType enum:

use utah::prelude::*;
let a = arr2(&[[InnerType::Float(2.0), InnerType::Str("ak".into())],
               [InnerType::Int32(6), InnerType::Int64(10)]]);
let df : DataFrame<InnerType> = DataFrame::new(a);

Generate a 1-dimensional DataFrame from an 1-D array of data. When populating the dataframe with mixed-types, wrap the elements with InnerType enum.

use utah::prelude::*;
let a = arr1(&[2.0, 7.0]);
let df : DataFrame<f64> = DataFrame::from_array(a, UtahAxis::Column);

Populate the dataframe with a set of columns. The column elements can be any of OuterType. Example:

use utah::prelude::*;
let a = arr2(&[[2.0, 7.0], [3.0, 4.0]]);
let df : Result<DataFrame<f64>> = DataFrame::new(a).columns(&["a", "b"]);
df.is_ok();

Populate the dataframe with an index. The index elements can be any of OuterType. Example:

use utah::prelude::*;
let a = arr2(&[[2.0, 7.0], [3.0, 4.0]]);
let df : Result<DataFrame<f64>> = DataFrame::new(a).index(&["1", "2"]);
df.is_ok();

You can also populate the dataframe with both column names and index names, like so:

use utah::prelude::*;
let a = arr2(&[[2.0, 7.0], [3.0, 4.0]]);
let df : Result<DataFrame<f64>> = DataFrame::new(a).index(&["1", "2"]).unwrap().columns(&["a", "b"]);
df.is_ok();

Return a dataframe iterator over the specified UtahAxis.

The dataframe iterator yields a view of a row or column of the dataframe for eventual processing. Example:

use utah::prelude::*;
let a = arr2(&[[2.0, 7.0], [3.0, 4.0]]);
let df : DataFrame<f64> = DataFrame::new(a).index(&["1", "2"]).unwrap().columns(&["a", "b"]).unwrap();
let df_iter = df.df_iter(UtahAxis::Row);

Return a mutable dataframe iterator over the specified UtahAxis.

The mutable dataframe iterator yields a view of a row or column of the dataframe for eventual processing. Example:

use utah::prelude::*;
let a = arr2(&[[2.0, 7.0], [3.0, 4.0]]);
let mut df : DataFrame<f64> = DataFrame::new(a);
let df_iter_mut = df.df_iter_mut(UtahAxis::Column);

impl<'a, T> Operations<'a, T> for DataFrame<T> where
    T: 'a + UtahNum
[src]

Get the dimensions of the dataframe.

Select rows or columns over the specified UtahAxis.

Remove rows or columns over the specified UtahAxis.

Append a row or column along the specified UtahAxis.

Perform an inner left join between two dataframes along the specified UtahAxis.

Perform an outer left join between two dataframes along the specified UtahAxis.

Perform an inner right join between two dataframes along the specified UtahAxis.

Perform an outer right join between two dataframes along the specified UtahAxis.

Sum along the specified UtahAxis.

Map a function along the specified UtahAxis.

Get the average of entries along the specified UtahAxis.

Get the maximum of entries along the specified UtahAxis.

Get the minimum of entries along the specified UtahAxis.

Replace empty values with specified ImputeStrategy along the specified UtahAxis.