FrameView Class |
Namespace: Meta.Numerics.Data
The FrameView type exposes the following members.
Name | Description | |
---|---|---|
Columns |
Gets the columns of the table.
| |
ItemString |
Get the column with the given name.
| |
ItemInt32, Int32 |
Gets the value in the given cell.
| |
Rows |
Gets the rows of the table.
|
Name | Description | |
---|---|---|
AddComputedColumnT |
Add a computed column.
| |
AsColumnsT |
Exposes a list of columns of uniform type.
| |
Discard |
Constructs a new view that does not contain the given columns.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetColumnIndex |
Gets the index of a given column.
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GroupBy(String, FuncFrameView, IReadOnlyDictionaryString, Object) |
Groups the data by the values in the given column, and computes aggregate quantities for each group.
| |
GroupByT(String, FuncFrameView, T, String) |
Groups the data by the values in the given column, and computes the given aggregate quantity for each group.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OrderBy(String) |
Sorts the rows by the values in the given column.
| |
OrderBy(ComparisonFrameRow) |
Sorts all rows by the given function.
| |
OrderBy(String, SortOrder) |
Sort the rows by the values in the given column in the given direction.
| |
OrderByT(String, ComparisonT) |
Sorts all rows by the given function of the given column.
| |
Select(ICollectionString) |
Constructs a new view, containing only the given columns.
| |
Select(String) |
Constructs a new view, containing only the given columns.
| |
ToCsv |
Write the data in the view to a comma-separated-value file.
| |
ToDictionaries |
Writes the data in the view as a sequence of dictionaries.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Where(FuncFrameRow, Boolean) |
Selects rows matching the given criteria.
| |
WhereT(String, FuncT, Boolean) |
Selects rows in which the value of the given column matches the given criteria.
| |
WhereNotNull |
Removes any rows that have null values in the named columns.
|
This is the central class for viewing data in our data frame system.
The methods of this class allow rows and columns of data to be re-ordered, filtered, manipulated, and analyzed. Most of the methods produce a new FrameView that presents a new view of the underlying data, without incurring the time and space costs of copying the underlying stored data.
The simplest data manipulations supported by views include filtering columns using Select and Discard and filtering rows using Where and WhereNotNull.
More advanced manipulations include the addition of computed columns using AddComputedColumnT(String, FuncFrameRow, T) and the computation of aggregate values of groups using GroupBy.
After you have created the view of your data that you want to analyze, the easiest way to hand individual columns of data to column-oriented analysis APIs (like those in the Meta.Numerics.Statistics namespace) is to use the ItemString accessor to get a column, together with the AsT caster to expose it as a collection of the required type. For example, to obtain a estimate of the mean of the population from the sample in the column named "heights", write view["height"].As<double>().PopulationMean(). Note that, for this to succeed, the underlying storage type of the heights column need not be double. As long as the data are convertible to the target type, no problems will arise. For example, the underlying storage type might be int, or double? as long as no null values are present in the view.
To create the original array of data that will be manipulated, use the FrameTable class. Note that, because the underlying data is not copied when a new view is generated, changes to the original table may have unexpected consequences for the views linked to it. Best practice is not to change the underlying data after generating views based on it.
You can export a view to CSV or JSON formats using the ToCsv(TextWriter) and ToDictionaries methods.