[−][src]Struct utah2::dataframe::DataFrame
A read-only dataframe.
Fields
columns: Vec<String>
data: Matrix<T>
index: Vec<String>
Trait Implementations
impl<T: Clone> Clone for DataFrame<T> where
T: UtahNum,
[src]
T: UtahNum,
impl<'a, T> Constructor<'a, T> for DataFrame<T> where
T: UtahNum + 'a,
[src]
T: UtahNum + 'a,
fn new<U: Clone>(data: Matrix<U>) -> DataFrame<T> where
T: From<U>,
[src]
T: From<U>,
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);
fn from_array<U: Clone>(data: Row<U>, axis: UtahAxis) -> DataFrame<T> where
T: From<U>,
[src]
T: From<U>,
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);
fn columns<U: Clone>(self, columns: &'a [U]) -> Result<DataFrame<T>> where
String: From<U>,
[src]
String: From<U>,
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();
fn index<U: Clone>(self, index: &'a [U]) -> Result<DataFrame<T>> where
String: From<U>,
[src]
String: From<U>,
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();
ⓘImportant traits for DataFrameIterator<'a, T>fn df_iter(&'a self, axis: UtahAxis) -> DataFrameIterator<'a, T>
[src]
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);
ⓘImportant traits for DataFrameMutIterator<'a, T>fn df_iter_mut(&'a mut self, axis: UtahAxis) -> DataFrameMutIterator<'a, T>
[src]
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<T: Debug> Debug for DataFrame<T> where
T: UtahNum,
[src]
T: UtahNum,
impl<'a, T> Operations<'a, T> for DataFrame<T> where
T: 'a + UtahNum,
[src]
T: 'a + UtahNum,
fn shape(self) -> (usize, usize)
[src]
Get the dimensions of the dataframe.
fn select<U: ?Sized>(
&'a self,
names: &'a [&'a U],
axis: UtahAxis
) -> SelectIter<'a, T> where
String: From<&'a U>,
[src]
&'a self,
names: &'a [&'a U],
axis: UtahAxis
) -> SelectIter<'a, T> where
String: From<&'a U>,
Select rows or columns over the specified UtahAxis
.
fn remove<U: ?Sized>(
&'a self,
names: &'a [&'a U],
axis: UtahAxis
) -> RemoveIter<'a, T> where
String: From<&'a U>,
[src]
&'a self,
names: &'a [&'a U],
axis: UtahAxis
) -> RemoveIter<'a, T> where
String: From<&'a U>,
Remove rows or columns over the specified UtahAxis
.
fn append<U: ?Sized>(
&'a mut self,
name: &'a U,
data: ArrayView1<'a, T>,
axis: UtahAxis
) -> AppendIter<'a, T> where
String: From<&'a U>,
[src]
&'a mut self,
name: &'a U,
data: ArrayView1<'a, T>,
axis: UtahAxis
) -> AppendIter<'a, T> where
String: From<&'a U>,
Append a row or column along the specified UtahAxis
.
fn inner_left_join(&'a self, other: &'a DataFrame<T>) -> InnerJoinIter<'a, T>
[src]
Perform an inner left join between two dataframes along the specified UtahAxis
.
fn outer_left_join(&'a self, other: &'a DataFrame<T>) -> OuterJoinIter<'a, T>
[src]
Perform an outer left join between two dataframes along the specified UtahAxis
.
fn inner_right_join(&'a self, other: &'a DataFrame<T>) -> InnerJoinIter<'a, T>
[src]
Perform an inner right join between two dataframes along the specified UtahAxis
.
fn outer_right_join(&'a self, other: &'a DataFrame<T>) -> OuterJoinIter<'a, T>
[src]
Perform an outer right join between two dataframes along the specified UtahAxis
.
fn concat(
&'a self,
other: &'a DataFrame<T>,
axis: UtahAxis
) -> ConcatIter<'a, T>
[src]
&'a self,
other: &'a DataFrame<T>,
axis: UtahAxis
) -> ConcatIter<'a, T>
fn sumdf(&'a mut self, axis: UtahAxis) -> SumIter<'a, T>
[src]
Sum along the specified UtahAxis
.
fn mapdf<F>(&'a mut self, f: F, axis: UtahAxis) -> MapDFIter<'a, T, F> where
F: Fn(T) -> T,
[src]
F: Fn(T) -> T,
Map a function along the specified UtahAxis
.
fn mean(&'a mut self, axis: UtahAxis) -> MeanIter<'a, T>
[src]
Get the average of entries along the specified UtahAxis
.
fn maxdf(&'a mut self, axis: UtahAxis) -> MaxIter<'a, T>
[src]
Get the maximum of entries along the specified UtahAxis
.
fn mindf(&'a mut self, axis: UtahAxis) -> MinIter<'a, T>
[src]
Get the minimum of entries along the specified UtahAxis
.
fn impute(
&'a mut self,
strategy: ImputeStrategy,
axis: UtahAxis
) -> ImputeIter<'a, T>
[src]
&'a mut self,
strategy: ImputeStrategy,
axis: UtahAxis
) -> ImputeIter<'a, T>
Replace empty values with specified ImputeStrategy along the specified UtahAxis
.
impl<T: PartialEq> PartialEq<DataFrame<T>> for DataFrame<T> where
T: UtahNum,
[src]
T: UtahNum,
impl<T> ReadCSV<T> for DataFrame<T> where
T: UtahNum + Decodable + FromStr + Debug,
[src]
T: UtahNum + Decodable + FromStr + Debug,
impl<T> StructuralPartialEq for DataFrame<T> where
T: UtahNum,
[src]
T: UtahNum,
Auto Trait Implementations
impl<T> RefUnwindSafe for DataFrame<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for DataFrame<T> where
T: Send,
T: Send,
impl<T> Sync for DataFrame<T> where
T: Sync,
T: Sync,
impl<T> Unpin for DataFrame<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for DataFrame<T> where
T: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,