[−][src]Struct agnes::view::DataView
A DataView
is a specific view of data stored inside a DataStore
. It consists of a list of
DataFrame
objects, which themselves reference individual DataStore
s.
The type parameter Frames
is a ViewFrameCons
cons-list which contains the DataFrame
objects referenced by this DataView
. The type parameter Labels
is a FrameLookupCons
which
provides lookup functionality from a specific Label
into the Frames
cons-list.
Methods
impl<Labels, Frames> DataView<Labels, Frames>
[src]
impl<Labels, Frames> DataView<Labels, Frames>
[src]
pub fn fieldnames<'a>(&'a self) -> Vec<&'a str> where
Labels: StrLabels,
[src]
Labels: StrLabels,
Field names in this data view
impl<Labels, Frames> DataView<Labels, Frames> where
Frames: Clone,
[src]
Frames: Clone,
pub fn v<LabelList>(
&self
) -> DataView<<Labels as LabelSubset<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output> where
Labels: HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
Frames: SubsetClone<<Labels as FrameIndexList>::LabelList>,
[src]
&self
) -> DataView<<Labels as LabelSubset<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output> where
Labels: HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
Frames: SubsetClone<<Labels as FrameIndexList>::LabelList>,
Generate a new subview of this DataView
. LabelList is a
LabelCons list of labels, which can be generated using the
Labels macro.
pub fn subview<LabelList>(
&self
) -> DataView<<Labels as LabelSubset<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output> where
Labels: HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
Frames: SubsetClone<<Labels as FrameIndexList>::LabelList>,
[src]
&self
) -> DataView<<Labels as LabelSubset<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output> where
Labels: HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
Frames: SubsetClone<<Labels as FrameIndexList>::LabelList>,
Generate a new subview of this DataView
. Equivalent to v.
impl<Labels, Frames> DataView<Labels, Frames> where
Frames: NRows,
[src]
Frames: NRows,
impl<Labels, Frames> DataView<Labels, Frames> where
Labels: Len,
Frames: Len,
[src]
Labels: Len,
Frames: Len,
pub fn is_empty(&self) -> bool
[src]
Returns true
if the DataView is empty (has no rows or has no fields)
impl<Labels, Frames> DataView<Labels, Frames> where
Labels: Len,
[src]
Labels: Len,
impl<Labels, Frames> DataView<Labels, Frames> where
Frames: Len,
[src]
Frames: Len,
impl<Labels, Frames> DataView<Labels, Frames>
[src]
pub fn relabel<CurrLabel, NewLabel>(
self
) -> DataView<<Labels as Relabel<CurrLabel, NewLabel>>::Output, Frames> where
Labels: Relabel<CurrLabel, NewLabel>,
[src]
self
) -> DataView<<Labels as Relabel<CurrLabel, NewLabel>>::Output, Frames> where
Labels: Relabel<CurrLabel, NewLabel>,
Construct a new DataView
with the label CurrLabel
relabeled with the label NewLabel
.
impl<Labels, Frames> DataView<Labels, Frames>
[src]
pub fn merge<RLabels, RFrames>(
&self,
right: &DataView<RLabels, RFrames>
) -> Result<Self::Output> where
Self: ViewMerge<DataView<RLabels, RFrames>>,
[src]
&self,
right: &DataView<RLabels, RFrames>
) -> Result<Self::Output> where
Self: ViewMerge<DataView<RLabels, RFrames>>,
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.
Fails if the two DataView
s have different number of rows.
impl<Labels, Frames> DataView<Labels, Frames>
[src]
pub fn join<Join, RLabels, RFrames>(
&self,
right: &DataView<RLabels, RFrames>
) -> Self::Output where
Self: SortMergeJoin<RLabels, RFrames, Join>,
[src]
&self,
right: &DataView<RLabels, RFrames>
) -> Self::Output where
Self: SortMergeJoin<RLabels, RFrames, Join>,
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.
impl<Labels, Frames> DataView<Labels, Frames> where
Frames: UpdatePermutation,
[src]
Frames: UpdatePermutation,
pub fn sort_by_label<Label>(&mut self) -> Vec<usize> where
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrder,
[src]
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrder,
Sorts this DataView
by the provided label. This sort is stable -- it preserves the
original order of equal elements. Returns the permutation (list of indices in
sorted order) of values in field identified by Label
.
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).
pub fn sort_unstable_by_label<Label>(&mut self) -> Vec<usize> where
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrderUnstable,
[src]
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrderUnstable,
Sorts this DataView
by the provided label. This sort is unstable -- it does not
necessarily preserve the original order of equal elements, but may be faster. Returns the
permutation (list of indices in sorted order) of values in field identified by Label
.
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).
pub fn sort_by_label_comparator<Label, F>(&mut self, compare: F) -> Vec<usize> where
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrderComparator<F>,
[src]
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrderComparator<F>,
Sorts this DataView
by the provided label using a specific comparator. This sort is
stable -- it preserves the original order of equal elements. Returns the permutation (list
of indices in sorted order) of values in field identified by Label
.
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).
pub fn sort_unstable_by_label_comparator<Label, F>(
&mut self,
compare: F
) -> Vec<usize> where
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrderUnstableComparator<F>,
[src]
&mut self,
compare: F
) -> Vec<usize> where
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrderUnstableComparator<F>,
Sorts this DataView
by the provided label using a specific comparator. This sort is
unstable -- it does not necessarily preserve the original order of equal elements, but may
be faster. Returns the permutation (list of indices in sorted order) of values in field
identified by Label
.
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).
pub fn filter<Label, P>(&mut self, predicate: P) -> Vec<usize> where
Self: SelectFieldByLabel<Label>,
Self::Output: FilterPerm<P>,
[src]
Self: SelectFieldByLabel<Label>,
Self::Output: FilterPerm<P>,
Filters this DataView
by predicate
(a function mapping from Value<&T>
to bool
where
T
is the type of the field with label Label
). Mutates this DataView
so only those
rows where values within the field with label Label
matching prediate
remain.
Returns the indices of the values that matched predicate
in the oringal DataView
(before
filtering).
impl<Labels, Frames> DataView<Labels, Frames>
[src]
pub fn field_list<LabelList>(
&self
) -> <Labels as FieldList<LabelList, Frames>>::Output where
Labels: FieldList<LabelList, Frames>,
[src]
&self
) -> <Labels as FieldList<LabelList, Frames>>::Output where
Labels: FieldList<LabelList, Frames>,
Returns a cons-list of fields (implementing DataIndex)
that match the labels in LabelList
.
pub fn unique_indices<LabelList>(&self) -> Vec<usize> where
Labels: FieldList<LabelList, Frames>,
<Labels as FieldList<LabelList, Frames>>::Output: HashIndex + PartialEqIndex,
Frames: NRows,
[src]
Labels: FieldList<LabelList, Frames>,
<Labels as FieldList<LabelList, Frames>>::Output: HashIndex + PartialEqIndex,
Frames: NRows,
Computes the set of unique composite values among the fields in this DataView
associated
with labels in LabelList
. Returns the indices of exemplar rows, one index for each unique
value. Taken as a set, the values of the LabelList
-labeled fields at the indices returned
by this method represent all the possible combinations of values of these fields that exist
in this DataView
.
Fields referenced by LabelList
must implement Hash
.
pub fn unique_values<LabelList>(
&self
) -> DataView<<Labels as LabelSubset<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output> where
Labels: HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
Frames: SubsetClone<<Labels as FrameIndexList>::LabelList>,
<Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output: UpdatePermutation,
Labels: FieldList<LabelList, Frames>,
<Labels as FieldList<LabelList, Frames>>::Output: HashIndex + PartialEqIndex,
Frames: NRows,
[src]
&self
) -> DataView<<Labels as LabelSubset<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output> where
Labels: HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
Frames: SubsetClone<<Labels as FrameIndexList>::LabelList>,
<Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output: UpdatePermutation,
Labels: FieldList<LabelList, Frames>,
<Labels as FieldList<LabelList, Frames>>::Output: HashIndex + PartialEqIndex,
Frames: NRows,
Computes the set of unique composite values among the fields in this DataView
associated
with labels in LabelList
. Returns a new DataView
with those specific sets of values. The
returned DataView
contains the values of the LabelList
-labeled fields that represent
all the possible combinations of values of these fields that exist in the original
DataView
.
Fields referenced by LabelList
must implement Hash
.
impl<Labels, Frames> DataView<Labels, Frames> where
Frames: Len + NRows + AssocDataIndexCons<Labels>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<MinFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<MaxFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<SumFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<MeanFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<StDevFn>,
Labels: Len + StrLabels + StrTypes,
[src]
Frames: Len + NRows + AssocDataIndexCons<Labels>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<MinFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<MaxFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<SumFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<MeanFn>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<StDevFn>,
Labels: Len + StrLabels + StrTypes,
pub fn view_stats(&self) -> ViewStats
[src]
Compute and return general statistics for this DataView
.
Trait Implementations
impl<LLabels, LFrames, RLabels, RFrames> Merge<RLabels, RFrames> for DataView<LLabels, LFrames> where
LFrames: Len,
RLabels: UpdateFrameIndexMarker<<LFrames as Len>::Len>,
LLabels: Append<<RLabels as UpdateFrameIndexMarker<<LFrames as Len>::Len>>::Output>,
RFrames: Clone + UpdateFrameIndex<<LFrames as Len>::Len>,
LFrames: Append<<RFrames as UpdateFrameIndex<<LFrames as Len>::Len>>::Output> + Clone,
[src]
LFrames: Len,
RLabels: UpdateFrameIndexMarker<<LFrames as Len>::Len>,
LLabels: Append<<RLabels as UpdateFrameIndexMarker<<LFrames as Len>::Len>>::Output>,
RFrames: Clone + UpdateFrameIndex<<LFrames as Len>::Len>,
LFrames: Append<<RFrames as UpdateFrameIndex<<LFrames as Len>::Len>>::Output> + Clone,
type OutLabels = <LLabels as Append<<RLabels as UpdateFrameIndexMarker<<LFrames as Len>::Len>>::Output>>::Appended
Resulting Labels
type parameter of merged DataView
object.
type OutFrames = <LFrames as Append<<RFrames as UpdateFrameIndex<<LFrames as Len>::Len>>::Output>>::Appended
Resulting Frames
type parameterof merged DataView
object.
fn merge(
&self,
right: &DataView<RLabels, RFrames>
) -> DataView<Self::OutLabels, Self::OutFrames>
[src]
&self,
right: &DataView<RLabels, RFrames>
) -> DataView<Self::OutLabels, Self::OutFrames>
impl<LLabels, LFrames, RLabels, RFrames, LLabel, RLabel, Pred> SortMergeJoin<RLabels, RFrames, Join<LLabel, RLabel, Pred>> for DataView<LLabels, LFrames> where
LFrames: JoinIntoStore<LLabels, DataStore<Nil>>,
RFrames: JoinIntoStore<RLabels, <LFrames as JoinIntoStore<LLabels, DataStore<Nil>>>::Output>,
<RFrames as JoinIntoStore<RLabels, <LFrames as JoinIntoStore<LLabels, DataStore<Nil>>>::Output>>::Output: IntoView,
Self: SelectFieldByLabel<LLabel>,
Self::Output: SortOrder,
VFieldTypeOf<Self, LLabel>: Ord + PartialEq,
DataView<RLabels, RFrames>: SelectFieldByLabel<RLabel>,
<DataView<RLabels, RFrames> as SelectFieldByLabel<RLabel>>::Output: SortOrder,
VFieldOf<DataView<RLabels, RFrames>, RLabel>: DataIndex<DType = VFieldTypeOf<Self, LLabel>>,
Pred: Predicate,
[src]
LFrames: JoinIntoStore<LLabels, DataStore<Nil>>,
RFrames: JoinIntoStore<RLabels, <LFrames as JoinIntoStore<LLabels, DataStore<Nil>>>::Output>,
<RFrames as JoinIntoStore<RLabels, <LFrames as JoinIntoStore<LLabels, DataStore<Nil>>>::Output>>::Output: IntoView,
Self: SelectFieldByLabel<LLabel>,
Self::Output: SortOrder,
VFieldTypeOf<Self, LLabel>: Ord + PartialEq,
DataView<RLabels, RFrames>: SelectFieldByLabel<RLabel>,
<DataView<RLabels, RFrames> as SelectFieldByLabel<RLabel>>::Output: SortOrder,
VFieldOf<DataView<RLabels, RFrames>, RLabel>: DataIndex<DType = VFieldTypeOf<Self, LLabel>>,
Pred: Predicate,
type Output = <<RFrames as JoinIntoStore<RLabels, <LFrames as JoinIntoStore<LLabels, DataStore<Nil>>>::Output>>::Output as IntoView>::Output
Resultant data structure after join.
fn join(&self, right: &DataView<RLabels, RFrames>) -> Self::Output
[src]
impl<Labels, Frames> FieldSelect for DataView<Labels, Frames>
[src]
fn field<Label>(&self) -> Self::Output where
Self: SelectFieldByLabel<Label>,
[src]
Self: SelectFieldByLabel<Label>,
Returns a struct containing the data for the field specified by Label
. Read more
impl<Labels, Frames, Label> SelectFieldByLabel<Label> for DataView<Labels, Frames> where
Frames: SelectFieldFromLabels<Labels, Label>,
[src]
Frames: SelectFieldFromLabels<Labels, Label>,
type Output = <Frames as SelectFieldFromLabels<Labels, Label>>::Output
The return type for the select_field
method.
fn select_field(&self) -> Self::Output
[src]
impl<Labels, Frames, RLabels, RFrames> ViewMerge<DataView<RLabels, RFrames>> for DataView<Labels, Frames> where
Self: Merge<RLabels, RFrames>,
RFrames: NRows,
Frames: NRows,
Self::OutLabels: IsLabelSet<IsSet = True>,
[src]
Self: Merge<RLabels, RFrames>,
RFrames: NRows,
Frames: NRows,
Self::OutLabels: IsLabelSet<IsSet = True>,
type Output = DataView<Self::OutLabels, Self::OutFrames>
Resultant DataView
type.
fn merge(&self, right: &DataView<RLabels, RFrames>) -> Result<Self::Output>
[src]
impl<Labels: Default, Frames: Default> Default for DataView<Labels, Frames>
[src]
impl<Labels: Clone, Frames: Clone> Clone for DataView<Labels, Frames>
[src]
fn clone(&self) -> DataView<Labels, Frames>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Labels, Frames> Display for DataView<Labels, Frames> where
Frames: Len + NRows + AssocDataIndexCons<Labels>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<AddCellToRowFn>,
Labels: StrLabels,
[src]
Frames: Len + NRows + AssocDataIndexCons<Labels>,
AssocDataIndexConsOf<Labels, Frames>: DeriveCapabilities<AddCellToRowFn>,
Labels: StrLabels,
impl<Labels: Debug, Frames: Debug> Debug for DataView<Labels, Frames>
[src]
impl<Labels, Frames> Serialize for DataView<Labels, Frames> where
Labels: Len + SerializeViewField<Frames>,
[src]
Labels: Len + SerializeViewField<Frames>,
Auto Trait Implementations
impl<Labels, Frames> Send for DataView<Labels, Frames> where
Frames: Send,
Labels: Send,
Frames: Send,
Labels: Send,
impl<Labels, Frames> Sync for DataView<Labels, Frames> where
Frames: Sync,
Labels: Sync,
Frames: Sync,
Labels: Sync,
Blanket Implementations
impl<T> IntoLabeled for T
[src]
impl<T> HasLabels for T
[src]
impl<Needle, Haystack> HasLabels for Haystack where
Haystack: Member<Needle, IsMember = B1>,
Needle: Label,
[src]
Haystack: Member<Needle, IsMember = B1>,
Needle: Label,
impl<Frames, Store> JoinIntoStore for Frames
[src]
type Output = Store
The output type after augmenting Store
.
fn join_into_store(&Self, Store, &[usize]) -> Result<Store, AgnesError>
[src]
impl<Frames> AssocDataIndexCons for Frames
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> Same for T
[src]
type Output = T
Should always be Self