Struct agnes::view::DataView [−][src]
pub struct DataView<DTypes> where
DTypes: DTypeList, { /* fields omitted */ }
A 'view' into a data store. The primary struct for viewing and manipulating data.
Methods
impl<DTypes> DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> DataView<DTypes> where
DTypes: DTypeList,
pub fn v<L: IntoFieldList>(&self, s: L) -> DataView<DTypes>
[src]
pub fn v<L: IntoFieldList>(&self, s: L) -> DataView<DTypes>
Generate a new subview of this DataView.
pub fn subview<L: IntoFieldList>(&self, s: L) -> Result<DataView<DTypes>>
[src]
pub fn subview<L: IntoFieldList>(&self, s: L) -> Result<DataView<DTypes>>
Generate a new subview of this DataView, generating an error if a specified field does not exist.
pub fn nrows(&self) -> usize where
DTypes::Storage: MaxLen<DTypes>,
[src]
pub fn nrows(&self) -> usize where
DTypes::Storage: MaxLen<DTypes>,
Number of rows in this data view
pub fn is_empty(&self) -> bool where
DTypes::Storage: MaxLen<DTypes>,
[src]
pub fn is_empty(&self) -> bool where
DTypes::Storage: MaxLen<DTypes>,
Returns true
if the DataView is empty (has no rows or has no fields)
pub fn nfields(&self) -> usize
[src]
pub fn nfields(&self) -> usize
Number of fields in this data view
pub fn fieldnames(&self) -> Vec<&FieldIdent>
[src]
pub fn fieldnames(&self) -> Vec<&FieldIdent>
Field names in this data view
pub fn has_field(&self, s: &FieldIdent) -> bool
[src]
pub fn has_field(&self, s: &FieldIdent) -> bool
Returns true
if this DataView
contains this field.
pub fn rename<T, U>(&mut self, orig: T, new: U) -> Result<()> where
T: Into<FieldIdent>,
U: Into<FieldIdent>,
[src]
pub fn rename<T, U>(&mut self, orig: T, new: U) -> Result<()> where
T: Into<FieldIdent>,
U: Into<FieldIdent>,
Rename a field of this DataView.
pub fn merge(&self, other: &DataView<DTypes>) -> Result<DataView<DTypes>> where
DTypes::Storage: MaxLen<DTypes>,
[src]
pub fn merge(&self, other: &DataView<DTypes>) -> Result<DataView<DTypes>> where
DTypes::Storage: MaxLen<DTypes>,
Merge this DataView
with another DataView
object, creating a new DataView
with the
same number of rows and all the fields from both source DataView
objects.
pub fn join<'b, T>(
&'b self,
other: &'b DataView<DTypes>,
join: &Join
) -> Result<DataStore<DTypes>> where
T: 'static + DataType<DTypes> + DtOrd + PartialEq + Default,
DTypes: 'b,
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T> + CreateStorage + for<'c> FramedMapExt<DTypes, CopyIntoFn<'c, DTypes>, ()>,
[src]
pub fn join<'b, T>(
&'b self,
other: &'b DataView<DTypes>,
join: &Join
) -> Result<DataStore<DTypes>> where
T: 'static + DataType<DTypes> + DtOrd + PartialEq + Default,
DTypes: 'b,
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T> + CreateStorage + for<'c> FramedMapExt<DTypes, CopyIntoFn<'c, DTypes>, ()>,
Combine two DataView
objects using specified join, creating a new DataStore
object with
a subset of records from the two source DataView
s according to the join parameters.
Note that since this is creating a new DataStore
object, it will be allocated new data to
store the contents of the joined DataView
s.
pub fn idents(&self) -> Keys<FieldIdent, ViewField>
[src]
pub fn idents(&self) -> Keys<FieldIdent, ViewField>
Returns an iterator over the fields (as FieldIdent
s of this DataView.
pub fn map<F, FOut, I>(&self, ident: I, f: F) -> Result<FOut> where
DTypes::Storage: FramedMap<DTypes, F, FOut>,
I: Into<FieldIdent>,
[src]
pub fn map<F, FOut, I>(&self, ident: I, f: F) -> Result<FOut> where
DTypes::Storage: FramedMap<DTypes, F, FOut>,
I: Into<FieldIdent>,
Applies the provided Func
to the data in the specified field. This Func
must be
implemented for all types in DTypes
.
Fails if the specified identifier is not found in this DataView
.
pub fn tmap<T, F, I>(&self, ident: I, f: F) -> Result<F::Output> where
F: Func<DTypes, T>,
T: DataType<DTypes>,
DTypes::Storage: MaxLen<DTypes> + FramedTMap<DTypes, T, F>,
I: Into<FieldIdent>,
[src]
pub fn tmap<T, F, I>(&self, ident: I, f: F) -> Result<F::Output> where
F: Func<DTypes, T>,
T: DataType<DTypes>,
DTypes::Storage: MaxLen<DTypes> + FramedTMap<DTypes, T, F>,
I: Into<FieldIdent>,
Applies the provided Func
to the data in the specified field. This Func
must be
implemented for type T
.
Fails if the specified identifier is not found in this DataView
or the incorrect type T
is used.
pub fn map_ext<F, FOut, I>(&self, ident: I, f: F) -> Result<FOut> where
DTypes::Storage: FramedMapExt<DTypes, F, FOut>,
I: Into<FieldIdent>,
[src]
pub fn map_ext<F, FOut, I>(&self, ident: I, f: F) -> Result<FOut> where
DTypes::Storage: FramedMapExt<DTypes, F, FOut>,
I: Into<FieldIdent>,
Applies the provided FuncExt
to the data in the specified field. This FuncExt
must be
implemented for all types in DTypes
.
Fails if the specified identifier is not found in this DataView
.
pub fn map_partial<F, I>(&self, ident: I, f: F) -> Result<Option<F::Output>> where
DTypes::Storage: MapPartial<DTypes, F> + MaxLen<DTypes>,
F: FuncPartial<DTypes>,
I: Into<FieldIdent>,
[src]
pub fn map_partial<F, I>(&self, ident: I, f: F) -> Result<Option<F::Output>> where
DTypes::Storage: MapPartial<DTypes, F> + MaxLen<DTypes>,
F: FuncPartial<DTypes>,
I: Into<FieldIdent>,
Applies the provided FuncPartial
to the data in the specified field.
Fails if the specified identifier is not found in this DataView
.
pub fn sort_by<'a>(&'a mut self, ident: &FieldIdent) -> Result<Vec<usize>> where
DTypes::Storage: FramedMap<DTypes, SortOrderFn, Vec<usize>>,
[src]
pub fn sort_by<'a>(&'a mut self, ident: &FieldIdent) -> Result<Vec<usize>> where
DTypes::Storage: FramedMap<DTypes, SortOrderFn, Vec<usize>>,
Returns the permutation (list of indices in sorted order) of values in field identified
by ident
.
The resulting permutation denotes the order of values in ascending order, with missing (NA) values at the beginning of the order (considered to be of 'lesser' value than existing values).
Fails if the field is not found in this DataView
.
impl<DTypes> DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> DataView<DTypes> where
DTypes: DTypeList,
pub fn as_fieldview(&self) -> Option<FieldView<DTypes>>
[src]
pub fn as_fieldview(&self) -> Option<FieldView<DTypes>>
Create a FieldView
object from a DataView
object, if possible. Typically, use this on
DataView
objects with only a single field; however, if the DataView
object has multiple
fields, the first one will be used for this FieldView
. Returns None
if the DataView
has no fields (is empty).
impl<DTypes: DTypeList> DataView<DTypes> where
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes>,
MinFn: FuncPartial<DTypes>,
<MinFn as FuncPartial<DTypes>>::Output: ToString,
MaxFn: FuncPartial<DTypes>,
<MaxFn as FuncPartial<DTypes>>::Output: ToString,
SumFn: FuncPartial<DTypes>,
<SumFn as FuncPartial<DTypes>>::Output: ToString,
MeanFn: FuncPartial<DTypes>,
<MeanFn as FuncPartial<DTypes>>::Output: ToString,
StdevFn: FuncPartial<DTypes>,
<StdevFn as FuncPartial<DTypes>>::Output: ToString,
DTypes::Storage: MapPartial<DTypes, StringifyFn<MinFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<MaxFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<SumFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<MeanFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<StdevFn>>,
[src]
impl<DTypes: DTypeList> DataView<DTypes> where
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes>,
MinFn: FuncPartial<DTypes>,
<MinFn as FuncPartial<DTypes>>::Output: ToString,
MaxFn: FuncPartial<DTypes>,
<MaxFn as FuncPartial<DTypes>>::Output: ToString,
SumFn: FuncPartial<DTypes>,
<SumFn as FuncPartial<DTypes>>::Output: ToString,
MeanFn: FuncPartial<DTypes>,
<MeanFn as FuncPartial<DTypes>>::Output: ToString,
StdevFn: FuncPartial<DTypes>,
<StdevFn as FuncPartial<DTypes>>::Output: ToString,
DTypes::Storage: MapPartial<DTypes, StringifyFn<MinFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<MaxFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<SumFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<MeanFn>>,
DTypes::Storage: MapPartial<DTypes, StringifyFn<StdevFn>>,
pub fn view_stats(&self) -> Result<ViewStats<DTypes>>
[src]
pub fn view_stats(&self) -> Result<ViewStats<DTypes>>
Compute and return general statistics for this DataView
.
impl<'a, DTypes> DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<'a, DTypes> DataView<DTypes> where
DTypes: DTypeList,
pub fn unique_indices<T, I>(&self, ident: I) -> Result<Vec<usize>> where
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T>,
T: 'static + DataType<DTypes> + Hash + Eq,
I: Into<FieldIdent>,
[src]
pub fn unique_indices<T, I>(&self, ident: I) -> Result<Vec<usize>> where
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T>,
T: 'static + DataType<DTypes> + Hash + Eq,
I: Into<FieldIdent>,
Returns a Vec
of indices that point to the set of unique values of the specified
identifier.
Fails if identifier is not found in the DataView
or the incorrect type T
is specified.
pub fn unique<T, I>(&self, ident: I) -> Result<DataView<DTypes>> where
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T>,
T: 'static + DataType<DTypes> + Hash + Eq,
I: Into<FieldIdent>,
[src]
pub fn unique<T, I>(&self, ident: I) -> Result<DataView<DTypes>> where
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T>,
T: 'static + DataType<DTypes> + Hash + Eq,
I: Into<FieldIdent>,
Returns a newly constructed DataView
of the unique values of the specified identifier for
this DataView
.
Fails if the identifier is not found in the DataView
or the incorrect type T
is
specified.
Trait Implementations
impl<DTypes: Debug> Debug for DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes: Debug> Debug for DataView<DTypes> where
DTypes: DTypeList,
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<DTypes: Clone> Clone for DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes: Clone> Clone for DataView<DTypes> where
DTypes: DTypeList,
fn clone(&self) -> DataView<DTypes>
[src]
fn clone(&self) -> DataView<DTypes>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<DTypes: Default> Default for DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes: Default> Default for DataView<DTypes> where
DTypes: DTypeList,
impl<DTypes> Field<DTypes> for DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> Field<DTypes> for DataView<DTypes> where
DTypes: DTypeList,
fn field<'a, T: 'a + DataType<DTypes>, I: Into<FieldIdent>>(
&'a self,
ident: I
) -> Result<Selection<DTypes, Self::Output, T>> where
Self: SelectField<'a, T, DTypes>,
DTypes: 'a + AssocTypes,
DTypes::Storage: TypeSelector<DTypes, T>,
[src]
fn field<'a, T: 'a + DataType<DTypes>, I: Into<FieldIdent>>(
&'a self,
ident: I
) -> Result<Selection<DTypes, Self::Output, T>> where
Self: SelectField<'a, T, DTypes>,
DTypes: 'a + AssocTypes,
DTypes::Storage: TypeSelector<DTypes, T>,
Returns a Selection struct containing the data for the field specified by ident
. Read more
impl<'a, DTypes, T> SelectField<'a, T, DTypes> for DataView<DTypes> where
T: 'static + DataType<DTypes>,
DTypes: 'a + DTypeList,
DTypes::Storage: MaxLen<DTypes>,
[src]
impl<'a, DTypes, T> SelectField<'a, T, DTypes> for DataView<DTypes> where
T: 'static + DataType<DTypes>,
DTypes: 'a + DTypeList,
DTypes::Storage: MaxLen<DTypes>,
type Output = Framed<'a, DTypes, T>
The return type for the select
method.
fn select(&'a self, ident: FieldIdent) -> Result<Framed<'a, DTypes, T>> where
DTypes: AssocTypes,
DTypes::Storage: TypeSelector<DTypes, T>,
[src]
fn select(&'a self, ident: FieldIdent) -> Result<Framed<'a, DTypes, T>> where
DTypes: AssocTypes,
DTypes::Storage: TypeSelector<DTypes, T>,
Returns an object that provides DataIndex access to the data in the field specified by ident
. Read more
impl<DTypes, T> Filter<DTypes, T> for DataView<DTypes> where
DataFrame<DTypes>: Filter<DTypes, T> + Field<DTypes>,
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T>,
T: 'static + DataType<DTypes>,
[src]
impl<DTypes, T> Filter<DTypes, T> for DataView<DTypes> where
DataFrame<DTypes>: Filter<DTypes, T> + Field<DTypes>,
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes> + TypeSelector<DTypes, T>,
T: 'static + DataType<DTypes>,
fn filter<I: Into<FieldIdent>, F: Fn(&T) -> bool>(
&mut self,
ident: I,
pred: F
) -> Result<Vec<usize>>
[src]
fn filter<I: Into<FieldIdent>, F: Fn(&T) -> bool>(
&mut self,
ident: I,
pred: F
) -> Result<Vec<usize>>
Filter the contents of this data structure by applying the supplied predicate on the specified field. Read more
impl<DTypes> From<DataStore<DTypes>> for DataView<DTypes> where
DTypes: DTypeList,
[src]
impl<DTypes> From<DataStore<DTypes>> for DataView<DTypes> where
DTypes: DTypeList,
impl<DTypes> Display for DataView<DTypes> where
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes> + for<'a, 'b> Map<DTypes, FramedFunc<'a, DTypes, AddCellToRowFn<'b>>, ()>,
[src]
impl<DTypes> Display for DataView<DTypes> where
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes> + for<'a, 'b> Map<DTypes, FramedFunc<'a, DTypes, AddCellToRowFn<'b>>, ()>,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<DTypes> Serialize for DataView<DTypes> where
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes> + FieldSerialize<DTypes>,
[src]
impl<DTypes> Serialize for DataView<DTypes> where
DTypes: DTypeList,
DTypes::Storage: MaxLen<DTypes> + FieldSerialize<DTypes>,
Auto Trait Implementations
impl<DTypes> Send for DataView<DTypes> where
<DTypes as AssocTypes>::DType: Send + Sync,
<DTypes as AssocTypes>::Storage: Send + Sync,
impl<DTypes> Send for DataView<DTypes> where
<DTypes as AssocTypes>::DType: Send + Sync,
<DTypes as AssocTypes>::Storage: Send + Sync,
impl<DTypes> Sync for DataView<DTypes> where
<DTypes as AssocTypes>::DType: Send + Sync,
<DTypes as AssocTypes>::Storage: Send + Sync,
impl<DTypes> Sync for DataView<DTypes> where
<DTypes as AssocTypes>::DType: Send + Sync,
<DTypes as AssocTypes>::Storage: Send + Sync,