Frame<'TRowKey, 'TColumnKey> Type
A frame is the key Deedle data structure (together with series). It represents a data table (think spreadsheet or CSV file) with multiple rows and columns. The frame consists of row index, column index and data. The indices are used for efficient lookup when accessing data by the row key `'TRowKey` or by the column key `'TColumnKey`. Deedle frames are optimized for the scenario when all values in a given column are of the same type (but types of different columns can differ).
Joining, zipping and appending:
More info
Table of contents
- Other module members
- Accessors and slicing
- Fancy accessors
- Formatting and raw data access
- Indexing
- Joining, merging and zipping
- Joining, zipping and appending
- Operators
- Projection and filtering
- Series operations
- Windowing, chunking and grouping
Other module members
Constructors
| Constructor |
Description
|
|
|
Full Usage:
Frame(rowIndex, columnIndex, data, indexBuilder, vectorBuilder)
Parameters:
IIndex<'TRowKey>
columnIndex : IIndex<'TColumnKey>
data : IVector<IVector>
indexBuilder : IIndexBuilder
vectorBuilder : IVectorBuilder
Returns: Frame<'TRowKey, 'TColumnKey>
|
|
Instance members
| Instance member |
Description
|
|
|
Full Usage:
this.ColumnCount
Returns: int
|
|
|
|
Full Usage:
this.Format
Parameters:
bool
showInfo : bool
Returns: string
|
|
Full Usage:
this.FormatStrings
Parameters:
int
rowEndCount : int
columnStartCount : int
columnEndCount : int
printTypes : bool
Returns: string[][]
|
|
Full Usage:
this.GetAddressRange
Parameters:
RangeRestriction<Address>
Returns: Frame<'TRowKey, 'TColumnKey>
|
Internal helper used by `skip`, `take`, etc.
|
Full Usage:
this.GroupRowsBy
Parameters:
'TColumnKey
Returns: Frame<('TGroup * 'TRowKey), 'TColumnKey>
|
|
|
|
Full Usage:
this.GroupRowsUsing
Parameters:
Func<'TRowKey, ObjectSeries<'TColumnKey>, 'TGroup>
Returns: Frame<('TGroup * 'TRowKey), 'TColumnKey>
|
|
Full Usage:
this.RowCount
Returns: int
|
|
|
|
Static members
| Static member |
Description
|
Accessors and slicing
Instance members
| Instance member |
Description
|
Full Usage:
this.ColumnKeys
Returns: 'TColumnKey seq
|
|
|
|
|
|
|
|
Full Usage:
this.GetRow
Parameters:
'TRowKey
-
Specifies the key of the row to be returned
lookup : Lookup
-
Specifies how to find value in a frame with ordered rows when the key does not exactly match (look for nearest available value with the smaller/greater key).
Returns: Series<'TColumnKey, 'T>
|
Returns a row with the specieifed key. This method is generic and returns the result
as a series containing values of the specified type. To get heterogeneous series of
type
|
Full Usage:
this.GetRow
Parameters:
'TRowKey
-
Specifies the key of the row to be returned
Returns: Series<'TColumnKey, 'T>
|
Returns a row with the specieifed key. This method is generic and returns the result
as a series containing values of the specified type. To get heterogeneous series of
type
|
Full Usage:
this.GetRowAt
Parameters:
int
-
Offset (integer) of the row to be returned
Returns: Series<'TColumnKey, 'T>
|
Returns a row of the data frame that is located at the specified int offset.
This does not use the row key and directly accesses the frame data. This method
is generic and returns the result as a series containing values of the specified type.
To get heterogeneous series of type
|
Full Usage:
this.GetRowKeyAt
Parameters:
int
-
Offset (integer) of the row key to be returned
Returns: 'TRowKey
|
Returns the row key that is located at the specified int offset. If the index is invalid, `ArgumentOutOfRangeException` is thrown. You can get the corresponding row using `GetRowAt`.
|
|
|
Full Usage:
this.GetSubrange
Parameters:
('TRowKey * BoundaryBehavior) option
hi : ('TRowKey * BoundaryBehavior) option
Returns: Frame<'TRowKey, 'TColumnKey>
|
|
Full Usage:
this.IsEmpty
Returns: bool
|
|
Full Usage:
this[column, row]
Parameters:
'TColumnKey
row : 'TRowKey
Returns: obj
|
|
Full Usage:
this.RowKeys
Returns: 'TRowKey seq
|
|
|
|
|
|
Full Usage:
this.TryGetRow
Parameters:
'TRowKey
-
Specifies the key of the row to be returned
lookup : Lookup
-
Specifies how to find value in a frame with ordered rows when the key does not exactly match (look for nearest available value with the smaller/greater key).
Returns: OptionalValue<Series<'TColumnKey, 'T>>
|
Returns a row with the specieifed key wrapped in `OptionalValue`. When the specified key
is not found, the result is `OptionalValue.Missing`. This method is generic and returns the result
as a series containing values of the specified type. To get heterogeneous series of
type
|
Full Usage:
this.TryGetRow
Parameters:
'TRowKey
-
Specifies the key of the row to be returned
Returns: OptionalValue<Series<'TColumnKey, 'T>>
|
Returns a row with the specieifed key wrapped in `OptionalValue`. When the specified key
is not found, the result is `OptionalValue.Missing`. This method is generic and returns the result
as a series containing values of the specified type. To get heterogeneous series of
type
|
Full Usage:
this.TryGetRowObservation
Parameters:
'TRowKey
-
Specifies the key of the row to be returned
lookup : Lookup
-
Specifies how to find value in a frame with ordered rows when the key does not exactly match (look for nearest available value with the smaller/greater key).
Returns: OptionalValue<KeyValuePair<'TRowKey, Series<'TColumnKey, 'T>>>
|
Try to find a row with the specified row key, or using the specified `lookup` parameter, and return the found row together with its actual key in case `lookup` was used. In case the row is not found, `OptionalValue.Missing` is returned.
|
Fancy accessors
Instance members
| Instance member |
Description
|
|
|
Full Usage:
this.GetAllValues
Returns: 'R seq
|
|
|
|
|
|
Full Usage:
this.ToArray2D
Returns: 'R[,]
|
Returns data of the data frame as a 2D array. The method attempts to convert all values to the specified type 'R. If the specified type is 'float' or 'double' then the method automatically uses NaN. For other values, the default value has to be explicitly specified using another overload.
|
Full Usage:
this.ToArray2D
Parameters:
'R
-
Default value used to fill all missing values
Returns: 'R[,]
|
Returns data of the data frame as a 2D array. The method attempts to convert all values to the specified type 'R. When a value is missing, the specified `defaultValue` is used.
|
Full Usage:
this.ToJaggedArray
Returns: 'R array array
|
Returns data of the data frame as a jagged array. The method attempts to convert all values to the specified type 'R. If the specified type is 'float' or 'double' then the method automatically uses NaN. For other values, the default value has to be explicitly specified using another overload.
|
Full Usage:
this.ToJaggedArray
Parameters:
'R
-
Default value used to fill all missing values
Returns: 'R array array
|
Returns data of the data frame as a jagged array. The method attempts to convert all values to the specified type 'R. When a value is missing, the specified `defaultValue` is used.
|
Formatting and raw data access
Instance members
| Instance member |
Description
|
Full Usage:
this.Format
Parameters:
int
-
The number of rows at the beginning to be printed
rowEndCount : int
-
The number of rows at the end of the frame to be printed
columnStartCount : int
-
The number of columns at the beginning to be printed
columnEndCount : int
-
The number of columns at the end of the frame to be printed
printTypes : bool
-
When true, the types of vectors storing column data are printed
showInfo : bool
-
When true, additional information about the frame is printed
Returns: string
|
Shows the data frame content in a human-readable format. The resulting string shows all columns, but a limited number of rows.
|
Full Usage:
this.Format
Parameters:
int
-
The number of rows at the beginning to be printed
rowEndCount : int
-
The number of rows at the end of the frame to be printed
columnStartCount : int
-
The number of columns at the beginning to be printed
columnEndCount : int
-
The number of columns at the end of the frame to be printed
Returns: string
|
Shows the data frame content in a human-readable format. The resulting string shows all columns, but a limited number of rows.
|
Full Usage:
this.Format
Parameters:
int
-
The maximal number of rows to be printed
columnCount : int
-
The maximal number of columns to be printed
Returns: string
|
Shows the data frame content in a human-readable format. The resulting string shows all columns, but a limited number of rows.
|
Full Usage:
this.Format
Parameters:
bool
-
When true, the types of vectors storing column data are printed
Returns: string
|
Shows the data frame content in a human-readable format. The resulting string shows all columns, but a limited number of rows.
|
Full Usage:
this.Format
Returns: string
|
Shows the data frame content in a human-readable format. The resulting string shows all columns, but a limited number of rows.
|
|
|
Indexing
Instance members
| Instance member |
Description
|
Full Usage:
this.IndexRows
Parameters:
'TColumnKey
-
The name of a column in the original data frame that will be used for the new index. Note that the values in the column need to be unique.
Returns: Frame<'TNewRowIndex, 'TColumnKey>
|
Returns a data frame whose rows are indexed based on the specified column of the original data frame. The generic type parameter is (typically) needed to specify the type of the values in the required index column. The resulting frame will *not* contain the specified column. If you want to preserve the column, use the overload that takes `keepColumn` parameter.
|
Full Usage:
this.IndexRows
Parameters:
'TColumnKey
-
The name of a column in the original data frame that will be used for the new index. Note that the values in the column need to be unique.
keepColumn : bool
-
Specifies whether the column used as an index should be kept in the frame.
Returns: Frame<'TNewRowIndex, 'TColumnKey>
|
Returns a data frame whose rows are indexed based on the specified column of the original data frame. The generic type parameter is (typically) needed to specify the type of the values in the required index column.
|
Joining, merging and zipping
Instance members
| Instance member |
Description
|
|
Joining, zipping and appending
Instance members
| Instance member |
Description
|
Performs outer join on data frame and a series. The column key for the joined series must not occur in the current data frame. The rows are automatically aligned and unavailable values are marked as missing.
|
|
Full Usage:
this.Join
Parameters:
'TColumnKey
-
Column key to be used for the joined series
series : Series<'TRowKey, 'V>
-
Series to be joined with the current data frame
kind : JoinKind
-
Specifies the joining behavior on row indices. Use `JoinKind.Outer` and `JoinKind.Inner` to get the union and intersection of the row keys, respectively. Use `JoinKind.Left` and `JoinKind.Right` to use the current key of the left/right data frame.
Returns: Frame<'TRowKey, 'TColumnKey>
|
Join data frame and a series. The column key for the joined series must not occur in the current data frame. The rows are aligned and transformed according to the specified join kind.
|
Full Usage:
this.Join
Parameters:
'TColumnKey
-
Column key to be used for the joined series
series : Series<'TRowKey, 'V>
-
Series to be joined with the current data frame
kind : JoinKind
-
Specifies the joining behavior on row indices. Use `JoinKind.Outer` and `JoinKind.Inner` to get the union and intersection of the row keys, respectively. Use `JoinKind.Left` and `JoinKind.Right` to use the current key of the left/right data frame.
lookup : Lookup
-
When `kind` is `Left` or `Right` and the two frames have ordered row index, this parameter can be used to specify how to find value for a key when there is no exactly matching key or when there are missing values. Supported values are `Lookup.Exact`, `Lookup.ExactOrSmaller` and `Lookup.ExactOrGreater`.
Returns: Frame<'TRowKey, 'TColumnKey>
|
Join data frame and a series. The column key for the joined series must not occur in the current data frame. The rows are aligned and transformed according to the specified join kind. When the index of both objects is ordered, it is possible to specify `lookup` in order to align indices from other frame to the indices of the main frame (typically, to find the nearest key with available value for a key).
|
Performs outer join on two data frames. The columns of the joined frames must not overlap and their rows are aligned. The unavailable values are marked as missing.
|
|
Full Usage:
this.Join
Parameters:
Frame<'TRowKey, 'TColumnKey>
-
Other frame (right) to be joined with the current instance (left)
kind : JoinKind
-
Specifies the joining behavior on row indices. Use `JoinKind.Outer` and `JoinKind.Inner` to get the union and intersection of the row keys, respectively. Use `JoinKind.Left` and `JoinKind.Right` to use the current key of the left/right data frame.
Returns: Frame<'TRowKey, 'TColumnKey>
|
Join two data frames. The columns of the joined frames must not overlap and their rows are aligned and transformed according to the specified join kind. For more alignment options on ordered frames, see overload taking `lookup`.
|
Full Usage:
this.Join
Parameters:
Frame<'TRowKey, 'TColumnKey>
-
Other frame (right) to be joined with the current instance (left)
kind : JoinKind
-
Specifies the joining behavior on row indices. Use `JoinKind.Outer` and `JoinKind.Inner` to get the union and intersection of the row keys, respectively. Use `JoinKind.Left` and `JoinKind.Right` to use the current key of the left/right data frame.
lookup : Lookup
-
When `kind` is `Left` or `Right` and the two frames have ordered row index, this parameter can be used to specify how to find value for a key when there is no exactly matching key or when there are missing values. Supported values are `Lookup.Exact`, `Lookup.ExactOrSmaller` and `Lookup.ExactOrGreater`.
Returns: Frame<'TRowKey, 'TColumnKey>
|
Join two data frames. The columns of the joined frames must not overlap and their rows are aligned and transformed according to the specified join kind. When the index of both frames is ordered, it is possible to specify `lookup` in order to align indices from other frame to the indices of the main frame (typically, to find the nearest key with available value for a key).
|
|
Merge multiple data frames with non-overlapping values. The operation takes the union of columns and rows of the source data frames and then unions the values. An exception is thrown when both data frames define value for a column/row location, but the operation succeeds if one frame has a missing value at the location. Note that the rows are *not* automatically reindexed to avoid overlaps. This means that when a frame has rows indexed with ordinal numbers, you may need to explicitly reindex the row keys before calling append.
|
|
Merge multiple data frames with non-overlapping values. The operation takes the union of columns and rows of the source data frames and then unions the values. An exception is thrown when both data frames define value for a column/row location, but the operation succeeds if one frame has a missing value at the location. Note that the rows are *not* automatically reindexed to avoid overlaps. This means that when a frame has rows indexed with ordinal numbers, you may need to explicitly reindex the row keys before calling append.
|
|
Merge two data frames with non-overlapping values. The operation takes the union of columns and rows of the source data frames and then unions the values. An exception is thrown when both data frames define value for a column/row location, but the operation succeeds if one frame has a missing value at the location. Note that the rows are *not* automatically reindexed to avoid overlaps. This means that when a frame has rows indexed with ordinal numbers, you may need to explicitly reindex the row keys before calling append.
|
Full Usage:
this.Zip
Parameters:
Frame<'TRowKey, 'TColumnKey>
-
Other frame to be aligned and zipped with the current instance
op : Func<'V1, 'V2, 'V3>
-
A function that is applied to aligned values. The `Zip` operation is generic in the type of this function and the type of function is used to determine which values in the frames are zipped and which are left unchanged.
Returns: Frame<'TRowKey, 'TColumnKey>
|
Aligns two data frames using both column index and row index and apply the specified operation
on values of a specified type that are available in both data frames. This overload uses
`JoinKind.Outer` for both columns and rows.
Once aligned, the call
|
Full Usage:
this.Zip
Parameters:
Frame<'TRowKey, 'TColumnKey>
-
Other frame to be aligned and zipped with the current instance
columnKind : JoinKind
-
Specifies how to align columns (inner, outer, left or right join)
rowKind : JoinKind
-
Specifies how to align rows (inner, outer, left or right join)
lookup : Lookup
-
Specifies how to find matching value for a row (when using left or right join on rows) Supported values are `Lookup.Exact`, `Lookup.ExactOrSmaller` and `Lookup.ExactOrGreater`.
pointwise : bool
-
Specifies how to handle columns that are not matched. Set true to make unmatched column missing. Set false to left unmatched column unchanged.
op : Func<'V1, 'V2, 'V3>
-
A function that is applied to aligned values. The `Zip` operation is generic in the type of this function and the type of function is used to determine which values in the frames are zipped and which are left unchanged.
Returns: Frame<'TRowKey, 'TColumnKey>
|
Aligns two data frames using both column index and row index and apply the specified operation
on values of a specified type that are available in both data frames. The parameters `columnKind`,
and `rowKind` can be specified to determine how the alginment works (similarly to `Join`).
Column keys are always matched using `Lookup.Exact`, but `lookup` determines lookup for rows.
The parameter `pointwise` can be specified to determine the outcome of unmatched column.
Once aligned, the call
|
Operators
Static members
| Static member |
Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Projection and filtering
Instance members
| Instance member |
Description
|
Full Usage:
this.ColumnApply
Parameters:
ConversionKind
f : Func<Series<'TRowKey, 'T>, ISeries<'TRowKey>>
Returns: Frame<'TRowKey, 'TColumnKey>
|
|
|
|
|
|
|
Series operations
Instance members
| Instance member |
Description
|
Full Usage:
this.AddColumn
Parameters:
'TColumnKey
-
A key (or name) for the newly added column
series : ISeries<'TRowKey>
-
A data series to be added (the row key type has to match)
lookup : Lookup
-
Specify how to find value in the added series (look for nearest available value with the smaller/greater key).
|
Mutates the data frame by adding an additional data series as a new column with the specified column key. The operation uses left join and aligns new series to the existing frame keys. A parameter `lookup` can be used to specify how to find a value in the added series (if an exact key is not available). The `lookup` parameter can only be used with ordered indices. |
Full Usage:
this.AddColumn
Parameters:
'TColumnKey
-
A key (or name) for the newly added column
series : 'V seq
-
A sequence of values to be added
lookup : Lookup
-
Specify how to find value in the added series (look for nearest available value with the smaller/greater key).
|
Mutates the data frame by adding an additional data series as a new column with the specified column key. The sequence is aligned to the data frame based on ordering. If it is longer, it is trimmed and if it is shorter, missing values will be added. A parameter `lookup` can be used to specify how to find a value in the added series (if the sequence contains invalid values like `null` or `NaN`).
|
Full Usage:
this.AddColumn
Parameters:
'TColumnKey
-
A key (or name) for the newly added column
series : ISeries<'TRowKey>
-
A data series to be added (the row key type has to match)
|
Mutates the data frame by adding an additional data series as a new column with the specified column key. The operation uses left join and aligns new series to the existing frame keys.
|
Full Usage:
this.AddColumn
Parameters:
'TColumnKey
-
A key (or name) for the newly added column
series : 'V seq
-
A sequence of values to be added
|
Mutates the data frame by adding an additional data series as a new column with the specified column key. The sequence is aligned to the data frame based on ordering. If it is longer, it is trimmed and if it is shorter, missing values will be added.
|
Full Usage:
this.DropColumn
Parameters:
'TColumnKey
-
The key (or name) to be dropped from the frame
|
Mutates the data frame by removing the specified series from the frame columns. The operation throws if the column key is not found.
|
Full Usage:
this.GetAllColumns
Parameters:
ConversionKind
Returns: KeyValuePair<'TColumnKey, Series<'TRowKey, 'R>> seq
|
|
|
|
|
|
|
|
|
|
Full Usage:
this[column]
Returns: 'TColumnKey
|
|
Full Usage:
this.RenameColumn
Parameters:
'TColumnKey
newKey : 'TColumnKey
|
|
|
|
Full Usage:
this.RenameColumns
Parameters:
'TColumnKey seq
|
|
Full Usage:
this.ReplaceColumn
Parameters:
'TColumnKey
-
A key (or name) for the column to be replaced or added
data : 'V seq
-
A sequence of values to be added
|
Mutates the data frame by replacing the specified series with a new data sequence . (If the series does not exist, only the new series is added.)
|
Full Usage:
this.ReplaceColumn
Parameters:
'TColumnKey
-
A key (or name) for the column to be replaced or added
series : ISeries<'TRowKey>
-
A data series to be used (the row key type has to match)
|
Mutates the data frame by replacing the specified series with a new series. (If the series does not exist, only the new series is added.)
|
Full Usage:
this.ReplaceColumn
Parameters:
'TColumnKey
-
A key (or name) for the column to be replaced or added
data : 'V seq
-
A data series to be used (the row key type has to match)
lookup : Lookup
-
Specify how to find value in the added series (look for nearest available value with the smaller/greater key).
|
Mutates the data frame by replacing the specified series with a new data sequence. (If the series does not exist, only the new series is added.) When adding a series, the specified `lookup` parameter is used for filling missing values (e.g. `null` or `NaN`). The parameter can only be used for frame with ordered indices.
|
Full Usage:
this.ReplaceColumn
Parameters:
'TColumnKey
-
A key (or name) for the column to be replaced or added
series : ISeries<'TRowKey>
-
A data series to be used (the row key type has to match)
lookup : Lookup
-
Specify how to find value in the added series (look for nearest available value with the smaller/greater key).
|
Mutates the data frame by replacing the specified series with a new series. (If the series does not exist, only the new series is added.) When adding a series, the specified `lookup` parameter is used for matching keys. The parameter can only be used for frame with ordered indices. |
Full Usage:
this.TryGetColumn
Parameters:
'TColumnKey
lookup : Lookup
Returns: OptionalValue<Series<'TRowKey, 'R>>
|
|
Full Usage:
this.TryGetColumnObservation
Parameters:
'TColumnKey
lookup : Lookup
Returns: OptionalValue<KeyValuePair<'TColumnKey, Series<'TRowKey, 'R>>>
|
|
Static members
| Static member |
Description
|
|
|
|
|
|
Windowing, chunking and grouping
Instance members
| Instance member |
Description
|
|
Returns a data frame whose rows are grouped by `groupBy` and whose columns specified in `aggBy` are aggregated according to `aggFunc`.
|
Deedle