[−][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) -> Self::Output where
Self: Subview<LabelList>,
[src]
Self: Subview<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) -> Self::Output where
Self: Subview<LabelList>,
[src]
Self: Subview<LabelList>,
Generate a new subview of this DataView
. Equivalent to v.
impl<Labels, Frames> DataView<Labels, Frames> where
Self: NRows,
[src]
Self: 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>(self) -> Self 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. Consumes the DataView
and returns a DataView
sorted by values from field identified by Label
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>(self) -> Self 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. Consumes the
DataView
and returns a DataView sorted by values from field identifier by
Label` 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>(self, compare: F) -> Self 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. Consumes the DataView
and
returns a DataView sorted by values from field identifier by
Label` 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>(self, compare: F) -> Self where
Self: SelectFieldByLabel<Label>,
Self::Output: SortOrderUnstableComparator<F>,
[src]
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. Consumes the DataView
and returns a DataView sorted by values from field identifier by
Label` 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>(self, predicate: P) -> Self 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
). Consumes this DataView
and returns a new
DataView
such that only those rows where values within the field with label Label
matching predicate
remain.
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
Self: Unique<LabelList>,
[src]
Self: Unique<LabelList>,
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) -> Self::Output where
Self: Unique<LabelList>,
[src]
Self: Unique<LabelList>,
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>
[src]
pub fn melt<MeltLabels, NameLabel, ValueLabel, HoldLabels>(
&self
) -> Self::Output where
Self: Melt<MeltLabels, NameLabel, ValueLabel, HoldLabels>,
[src]
&self
) -> Self::Output where
Self: Melt<MeltLabels, NameLabel, ValueLabel, HoldLabels>,
Creates a new a DataView
that accesses source data in a different way, viewing the data
as a series of identifier / value pairs instead of a having values in multiple
related fields.
This is useful when converting a data table in a wide format where several fields represent different instances of some quantity to a long format where each record only has one instance of the appropriate value.
The type parameter MeltLabels
is a LabelCons list of the
labels of the fields containing the values to 'melt'. NameLabel
is the desired label for
the new identifier field, which will contain the String
identifiers for where a record's
value originally came from. ValueLabel
is the desired label for the new value field, which
will contain the values associated with each of the corresponding String
identifiers.
HoldLabels
should be left for the compiler to infer using _
-- it specifies the
remaining fields that are not affected by this method.
Since the values from the fields denoted in MeltLabels
will all be combined into one field
they must be the same data type.
The resultant DataView
will be have the following field order: all the fields with labels
in HoldLabels
, the NameLabel
field, then the ValueLabel
field.
Example
Let us consider a table of employee salaries with the tablespace:
tablespace![ table salary { EmpId: u64, Year2010: f64, Year2011: f64, Year2012: f64, Year2013: f64, Year2014: f64, } ];
which, when first loaded from the source file, looks like this:
EmpId | Year2010 | Year2011 | Year2012 | Year2013 | Year2014
-------+----------+----------+----------+----------+----------
0 | 1500 | 1600 | 1700 | 1850 | 2000
1 | 900 | 920 | 940 | 940 | 970
2 | 600 | 800 | 900 | 1020 | 1100
While this is a valid way to store and present this data, there are definitely cases where
you might want to have the different years separated into different records instead of
having a column for each year. That's what melt
is for!
For the first step, we need to create new labels for melt
's NameLabel
and ValueLabel
type arguments. The NameLabel
will be filled in with String
identifiers for the field
a data point came from, and the ValueLabel
will be filled with the data values themselves.
We can add these two labels to our previous tablespace
call.
Next, after we load the original data, we call melt
:
tablespace![ table salary { EmpId: u64, Year2010: f64, Year2011: f64, Year2012: f64, Year2013: f64, Year2014: f64, SalaryYear: String, Salary: f64, } ]; fn main() { // <load data into DataView orig_table> // quick check to make sure we loaded the right table: with 3 rows, 6 fields assert_eq!((orig_table.nrows(), orig_table.nfields()), (3, 6)); let melted_table = orig_table.melt::< Labels![Year2010, Year2011, Year2012, Year2013, Year2014], SalaryYear, Salary, _, >(); // melted table should have 15 rows -- 5 for each of our 3 employees -- and 3 fields assert_eq!((melted_table.nrows(), melted_table.nfields()), (15, 3)); assert_eq!(melted_table.fieldnames(), vec!["EmpId", "SalaryYear", "Salary"]); println!("{}", melted_table); }
This call to melt
transforms the year fields into two new fields: one which contains the
salary year (text) and has the label SalaryYear, and one which contains the salary values
(floating-point) with the label Salary.
The first type argument is the list of year labels we want to melt, the second is the new label for the year specifier field, the third is the new label for the year value field, and we let the compiler compute the list of labels we aren't melting (in this case, the EmpId field).
As a result we should have a table with 15 rows, five for each of our three employees, and
three fields: EmpId
, SalaryYear
, and Salary
. This code should output:
EmpId | SalaryYear | Salary
-------+------------+--------
0 | Year2010 | 1500
0 | Year2011 | 1600
0 | Year2012 | 1700
0 | Year2013 | 1850
0 | Year2014 | 2000
1 | Year2010 | 900
1 | Year2011 | 920
1 | Year2012 | 940
1 | Year2013 | 940
1 | Year2014 | 970
2 | Year2010 | 600
2 | Year2011 | 800
2 | Year2012 | 900
2 | Year2013 | 1020
2 | Year2014 | 1100
impl<Labels, Frames> DataView<Labels, Frames>
[src]
pub fn aggregate<KeyLabels, ValueLabel, AggLabel, DType, AggType, AggFunc>(
&self,
init: AggType,
f: AggFunc
) -> Self::Output where
Self: Aggregate<KeyLabels, ValueLabel, AggLabel, DType, AggType>,
AggFunc: Fn(&mut AggType, Value<&DType>),
[src]
&self,
init: AggType,
f: AggFunc
) -> Self::Output where
Self: Aggregate<KeyLabels, ValueLabel, AggLabel, DType, AggType>,
AggFunc: Fn(&mut AggType, Value<&DType>),
Creates a new DataView
that aggregates values in the ValueLabel
field, grouping by
records in the KeyLabels
set of fields, and storing the result in a new field with
label AggLabel
. The resulting DataView
will contain the KeyLabels
fields and the
newly constructed AggLabel
field.
For each unique set of key values in KeyLabels
, this method will find all the records
in the DataView
which match, initialize an accumulator value with the argument init
,
and call AggFunc
for each of the values in the ValueLabel
field. AggFunc
takes a
mutable AggType
value which it updates with the
Values of type DType
from the ValueLabel
field.
Example
Let's start with the data table which contains three fields: an employee ID EmpId
, an
annual salary Salary
, and a text field denoting which year this salary took place:
SalaryYear
. This table (which is the final result of the example for the
melt documentation) can be represented with the
tablespace:
tablespace![ table salary { EmpId: u64, SalaryYear: String, Salary: f64, } ];
and data:
EmpId | SalaryYear | Salary
-------+------------+--------
0 | Year2010 | 1500
0 | Year2011 | 1600
0 | Year2012 | 1700
0 | Year2013 | 1850
0 | Year2014 | 2000
1 | Year2010 | 900
1 | Year2011 | 920
1 | Year2012 | 940
1 | Year2013 | 940
1 | Year2014 | 970
2 | Year2010 | 600
2 | Year2011 | 800
2 | Year2012 | 900
2 | Year2013 | 1020
2 | Year2014 | 1100
For this example, let's compute the total yearly salary being payed out to all employees.
Thus, we want to aggregate over each value in SalaryYear
, and compute the sum of Salary
.
Therefore, our KeyLabels
(our groups) would be Labels![SalaryYear]
(since we can have
more than one labels as our key, we need to use the label list-making macro
Labels). Our ValueLabel
(the value being summed) is Salary
, and
AggLabel
will be a new label we need to add to our tablespace, which we'll call
TotalYearlySalary
.
tablespace![ table salary { EmpId: u64, SalaryYear: String, Salary: f64, TotalYearlySalary: f64, } ]; fn main() { // <load data into DataView salary_table> // salary table should have 15 rows -- 5 years of data for each of our 3 employees -- // and 3 fields (employee ID, salary year name, and salary value) assert_eq!((salary_table.nrows(), salary_table.nfields()), (15, 3)); assert_eq!(salary_table.fieldnames(), vec!["EmpId", "SalaryYear", "Salary"]); println!("{}", salary_table); // compute the total salary per year, aggregated over employees let agg_table = salary_table .aggregate::<Labels![SalaryYear], Salary, TotalYearlySalary, _, _, _>( 0.0, |accum, val| { *accum = *accum + val.unwrap_or(&0.0); }, ); // we're left with five rows (one for each year of data), and two columns (year name and // sum) assert_eq!((agg_table.nrows(), agg_table.nfields()), (5, 2)); println!("{}", agg_table); }
The call to aggregate takes two arguments: the value used to initialized each of our five
aggregations (each of the five years), and a function which takes a mutable accumulator
and the datum value (a Value object) and updates the
accumulator by adding the value. We use unwrap_or
here to treat missing values a 0.0
.
The resulting printed table should be:
SalaryYear | TotalYearlySalary
------------+-------------------
Year2010 | 3000
Year2011 | 3320
Year2012 | 3540
Year2013 | 3810
Year2014 | 4070
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<Labels, Frames> NRows for DataView<Labels, Frames> where
Frames: NRows,
[src]
Frames: NRows,
impl<Labels, Frames> IntoFrame for DataView<Labels, Frames> where
Labels: SimpleFrameFields,
DataFrame<<Labels as SimpleFrameFields>::Fields, DataView<Labels, Frames>>: From<DataView<Labels, Frames>>,
[src]
Labels: SimpleFrameFields,
DataFrame<<Labels as SimpleFrameFields>::Fields, DataView<Labels, Frames>>: From<DataView<Labels, Frames>>,
type FrameFields = <Labels as SimpleFrameFields>::Fields
The FrameFields
type parameter for the output DataFrame
.
type FramedStore = DataView<Labels, Frames>
The FramedStore
type parameter for the output DataFrame
.
type Output = DataFrame<Self::FrameFields, Self::FramedStore>
The output DataFrame
(should always be DataFrame<Self::FrameFields, Self::FramedStore>
).
fn into_frame(self) -> Self::Output
[src]
impl<MeltLabel, Labels, Frames> IntoMeltFrame<MeltLabel> for DataView<Labels, Frames> where
Labels: MeltFrameFields<MeltLabel>,
[src]
Labels: MeltFrameFields<MeltLabel>,
type FrameFields = <Labels as MeltFrameFields<MeltLabel>>::Fields
The FrameFields
type parameter for the output DataFrame
.
type FramedStore = DataView<Labels, Frames>
The FramedStore
type parameter for the output DataFrame
.
type Output = DataFrame<Self::FrameFields, Self::FramedStore>
The output DataFrame
(should always be DataFrame<Self::FrameFields, Self::FramedStore>
).
fn into_melt_frame(self) -> Self::Output
[src]
impl<Labels, Frames, NewFrame> AddFrame<NewFrame> for DataView<Labels, Frames> where
NewFrame: AsFrameLookup<<Frames as Len>::Len>,
Frames: Len,
Labels: Append<<NewFrame as AsFrameLookup<<Frames as Len>::Len>>::Output>,
Frames: Clone + PushBack<Labeled<<Frames as Len>::Len, NewFrame>>,
[src]
NewFrame: AsFrameLookup<<Frames as Len>::Len>,
Frames: Len,
Labels: Append<<NewFrame as AsFrameLookup<<Frames as Len>::Len>>::Output>,
Frames: Clone + PushBack<Labeled<<Frames as Len>::Len, NewFrame>>,
type Output = DataView<<Labels as Append<<NewFrame as AsFrameLookup<<Frames as Len>::Len>>::Output>>::Appended, <Frames as PushBack<Labeled<<Frames as Len>::Len, NewFrame>>>::Output>
DataView
type after adding Frame
.
fn add_frame(&self, frame: NewFrame) -> Self::Output
[src]
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, DType = VFieldTypeOf<Self, LLabel>>,
<DataView<RLabels, RFrames> as SelectFieldByLabel<RLabel>>::Output: SortOrder,
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, DType = VFieldTypeOf<Self, LLabel>>,
<DataView<RLabels, RFrames> as SelectFieldByLabel<RLabel>>::Output: SortOrder,
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 DType = <Frames as SelectFieldFromLabels<Labels, Label>>::DType
Data type of accessed data.
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, LabelList> Subview<LabelList> for DataView<Labels, Frames> where
Labels: FrameIndexList + HasLabels<LabelList> + LabelSubset<LabelList>,
<Labels as LabelSubset<LabelList>>::Output: Reorder<LabelList>,
Frames: Clone + SubsetClone<<Labels as FrameIndexList>::LabelList>,
[src]
Labels: FrameIndexList + HasLabels<LabelList> + LabelSubset<LabelList>,
<Labels as LabelSubset<LabelList>>::Output: Reorder<LabelList>,
Frames: Clone + SubsetClone<<Labels as FrameIndexList>::LabelList>,
type Output = DataView<<<Labels as LabelSubset<LabelList>>::Output as Reorder<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output>
Resulting subview DataView
type.
fn subview(&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, Frames, LabelList> Unique<LabelList> for DataView<Labels, Frames> where
Labels: FieldList<LabelList, Frames> + HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
<Labels as FieldList<LabelList, Frames>>::Output: HashIndex + PartialEqIndex,
<Labels as LabelSubset<LabelList>>::Output: Reorder<LabelList>,
Frames: NRows + SubsetClone<<Labels as FrameIndexList>::LabelList>,
<Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output: UpdatePermutation,
[src]
Labels: FieldList<LabelList, Frames> + HasLabels<LabelList> + LabelSubset<LabelList> + FrameIndexList,
<Labels as FieldList<LabelList, Frames>>::Output: HashIndex + PartialEqIndex,
<Labels as LabelSubset<LabelList>>::Output: Reorder<LabelList>,
Frames: NRows + SubsetClone<<Labels as FrameIndexList>::LabelList>,
<Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output: UpdatePermutation,
type Output = DataView<<<Labels as LabelSubset<LabelList>>::Output as Reorder<LabelList>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output>
Output of the unique_values
method.
fn unique_indices(&self) -> Vec<usize>
[src]
fn unique_values(&self) -> Self::Output
[src]
impl<Frames, Labels, MeltLabels, NameLabel, ValueLabel, HoldLabels> Melt<MeltLabels, NameLabel, ValueLabel, HoldLabels> for DataView<Labels, Frames> where
Frames: NRows + Clone,
NameLabel: Debug,
Labels: SetDiff<MeltLabels, Set = HoldLabels>,
MeltLabels: Len + IntoStrFrame<NameLabel>,
<MeltLabels as IntoStrFrame<NameLabel>>::Output: IntoView,
Self: Subview<HoldLabels>,
Self::Output: IntoFrame,
<Self::Output as IntoFrame>::Output: UpdatePermutation,
<<MeltLabels as IntoStrFrame<NameLabel>>::Output as IntoView>::Output: AddFrame<<Self::Output as IntoFrame>::Output>,
Self: Subview<MeltLabels>,
Self::Output: IntoMeltFrame<ValueLabel>,
<<<MeltLabels as IntoStrFrame<NameLabel>>::Output as IntoView>::Output as AddFrame<<Self::Output as IntoFrame>::Output>>::Output: AddFrame<<Self::Output as IntoMeltFrame<ValueLabel>>::Output>,
HoldLabels: AssocLabels,
<HoldLabels as AssocLabels>::Labels: Append<LCons<NameLabel, LCons<ValueLabel, Nil>>>,
<<<<MeltLabels as IntoStrFrame<NameLabel>>::Output as IntoView>::Output as AddFrame<<Self::Output as IntoFrame>::Output>>::Output as AddFrame<<Self::Output as IntoMeltFrame<ValueLabel>>::Output>>::Output: Subview<<<HoldLabels as AssocLabels>::Labels as Append<LCons<NameLabel, LCons<ValueLabel, Nil>>>>::Appended>,
[src]
Frames: NRows + Clone,
NameLabel: Debug,
Labels: SetDiff<MeltLabels, Set = HoldLabels>,
MeltLabels: Len + IntoStrFrame<NameLabel>,
<MeltLabels as IntoStrFrame<NameLabel>>::Output: IntoView,
Self: Subview<HoldLabels>,
Self::Output: IntoFrame,
<Self::Output as IntoFrame>::Output: UpdatePermutation,
<<MeltLabels as IntoStrFrame<NameLabel>>::Output as IntoView>::Output: AddFrame<<Self::Output as IntoFrame>::Output>,
Self: Subview<MeltLabels>,
Self::Output: IntoMeltFrame<ValueLabel>,
<<<MeltLabels as IntoStrFrame<NameLabel>>::Output as IntoView>::Output as AddFrame<<Self::Output as IntoFrame>::Output>>::Output: AddFrame<<Self::Output as IntoMeltFrame<ValueLabel>>::Output>,
HoldLabels: AssocLabels,
<HoldLabels as AssocLabels>::Labels: Append<LCons<NameLabel, LCons<ValueLabel, Nil>>>,
<<<<MeltLabels as IntoStrFrame<NameLabel>>::Output as IntoView>::Output as AddFrame<<Self::Output as IntoFrame>::Output>>::Output as AddFrame<<Self::Output as IntoMeltFrame<ValueLabel>>::Output>>::Output: Subview<<<HoldLabels as AssocLabels>::Labels as Append<LCons<NameLabel, LCons<ValueLabel, Nil>>>>::Appended>,
type Output = <<<<<MeltLabels as IntoStrFrame<NameLabel>>::Output as IntoView>::Output as AddFrame<<Self::Output as IntoFrame>::Output>>::Output as AddFrame<<Self::Output as IntoMeltFrame<ValueLabel>>::Output>>::Output as Subview<<<HoldLabels as AssocLabels>::Labels as Append<LCons<NameLabel, LCons<ValueLabel, Nil>>>>::Appended>>::Output
Type produced by this melt method.
fn melt(&self) -> Self::Output
[src]
impl<Labels, Frames, KeyLabels, ValueLabel, AggLabel, DType, AggType> Aggregate<KeyLabels, ValueLabel, AggLabel, DType, AggType> for DataView<Labels, Frames> where
Self: NRows + SelectFieldByLabel<ValueLabel, DType = DType>,
Labels: FieldList<KeyLabels, Frames> + LabelSubset<KeyLabels> + FrameIndexList,
<Labels as FieldList<KeyLabels, Frames>>::Output: HashIndex + PartialEqIndex,
<Labels as LabelSubset<KeyLabels>>::Output: Reorder<KeyLabels>,
AggType: Clone,
FieldData<AggType>: IntoStore<AggLabel>,
<FieldData<AggType> as IntoStore<AggLabel>>::Output: IntoFrame,
Frames: NRows + SubsetClone<<Labels as FrameIndexList>::LabelList>,
<Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output: UpdatePermutation,
DataView<<<Labels as LabelSubset<KeyLabels>>::Output as Reorder<KeyLabels>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output>: AddFrame<<<FieldData<AggType> as IntoStore<AggLabel>>::Output as IntoFrame>::Output>,
[src]
Self: NRows + SelectFieldByLabel<ValueLabel, DType = DType>,
Labels: FieldList<KeyLabels, Frames> + LabelSubset<KeyLabels> + FrameIndexList,
<Labels as FieldList<KeyLabels, Frames>>::Output: HashIndex + PartialEqIndex,
<Labels as LabelSubset<KeyLabels>>::Output: Reorder<KeyLabels>,
AggType: Clone,
FieldData<AggType>: IntoStore<AggLabel>,
<FieldData<AggType> as IntoStore<AggLabel>>::Output: IntoFrame,
Frames: NRows + SubsetClone<<Labels as FrameIndexList>::LabelList>,
<Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output: UpdatePermutation,
DataView<<<Labels as LabelSubset<KeyLabels>>::Output as Reorder<KeyLabels>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output>: AddFrame<<<FieldData<AggType> as IntoStore<AggLabel>>::Output as IntoFrame>::Output>,
type Output = <DataView<<<Labels as LabelSubset<KeyLabels>>::Output as Reorder<KeyLabels>>::Output, <Frames as SubsetClone<<Labels as FrameIndexList>::LabelList>>::Output> as AddFrame<<<FieldData<AggType> as IntoStore<AggLabel>>::Output as IntoFrame>::Output>>::Output
Type produced by this aggregate method.
fn aggregate<AggFunc>(&self, init: AggType, f: AggFunc) -> Self::Output where
AggFunc: Fn(&mut AggType, Value<&DType>),
[src]
AggFunc: Fn(&mut AggType, Value<&DType>),
impl<Labels: Clone, Frames: Clone> Clone for DataView<Labels, Frames>
[src]
fn clone(&self) -> DataView<Labels, Frames>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Labels: Default, Frames: Default> Default for DataView<Labels, Frames>
[src]
impl<Labels, Frames> From<DataView<Labels, Frames>> for DataFrame<<Labels as SimpleFrameFields>::Fields, DataView<Labels, Frames>> where
Labels: SimpleFrameFields,
[src]
Labels: SimpleFrameFields,
fn from(
view: DataView<Labels, Frames>
) -> DataFrame<<Labels as SimpleFrameFields>::Fields, DataView<Labels, Frames>>
[src]
view: DataView<Labels, Frames>
) -> DataFrame<<Labels as SimpleFrameFields>::Fields, DataView<Labels, Frames>>
impl<Labels: Debug, Frames: Debug> Debug for DataView<Labels, Frames>
[src]
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, 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<DI> NRows for DI where
DI: DataIndex,
[src]
DI: DataIndex,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
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, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?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
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Erased for T
impl<T> Same for T
[src]
type Output = T
Should always be Self