[][src]Struct agnes::view::DataView

pub struct DataView<Labels, Frames> { /* fields omitted */ }

A DataView is a specific view of data stored inside a DataStore. It consists of a list of DataFrame objects, which themselves reference individual DataStores.

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]

pub fn new(frames: Frames) -> DataView<Labels, Frames>[src]

Creates a new DataView with frames.

impl<Labels, Frames> DataView<Labels, Frames>[src]

pub fn fieldnames<'a>(&'a self) -> Vec<&'a str> where
    Labels: StrLabels
[src]

Field names in this data view

impl<Labels, Frames> DataView<Labels, Frames> where
    Frames: Clone
[src]

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]

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]

Generate a new subview of this DataView. Equivalent to v.

impl<Labels, Frames> DataView<Labels, Frames> where
    Frames: NRows
[src]

pub fn nrows(&self) -> usize[src]

Number of rows in this data view

impl<Labels, Frames> DataView<Labels, Frames> where
    Labels: Len,
    Frames: Len
[src]

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]

pub fn nfields(&self) -> usize[src]

Number of fields in this data view

impl<Labels, Frames> DataView<Labels, Frames> where
    Frames: Len
[src]

pub fn nframes(&self) -> usize[src]

Number of frames this data view covers

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]

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]

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 DataViews 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]

Combine two DataView objects using specified join, creating a new DataStore object with a subset of records from the two source DataViews 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 DataViews.

impl<Labels, Frames> DataView<Labels, Frames> where
    Frames: UpdatePermutation
[src]

pub fn sort_by_label<Label>(&mut self) -> Vec<usize> where
    Self: SelectFieldByLabel<Label>,
    Self::Output: SortOrder
[src]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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.

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]

type Output = <<RFrames as JoinIntoStore<RLabels, <LFrames as JoinIntoStore<LLabels, DataStore<Nil>>>::Output>>::Output as IntoView>::Output

Resultant data structure after join.

impl<Labels, Frames> FieldSelect for DataView<Labels, Frames>[src]

fn field<Label>(&self) -> Self::Output where
    Self: SelectFieldByLabel<Label>, 
[src]

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]

type Output = <Frames as SelectFieldFromLabels<Labels, Label>>::Output

The return type for the select_field method.

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]

type Output = DataView<Self::OutLabels, Self::OutFrames>

Resultant DataView type.

impl<Labels: Default, Frames: Default> Default for DataView<Labels, Frames>[src]

impl<Labels: Clone, Frames: Clone> Clone for 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]

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]

Auto Trait Implementations

impl<Labels, Frames> Send for DataView<Labels, Frames> where
    Frames: Send,
    Labels: Send

impl<Labels, Frames> Sync for DataView<Labels, Frames> where
    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]

impl<Frames, Store> JoinIntoStore for Frames[src]

type Output = Store

The output type after augmenting Store.

impl<Frames> AssocDataIndexCons for Frames[src]

type Output = Nil

Type of associated data index cons-list.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Same for T[src]

type Output = T

Should always be Self