Logo Deedle

FrameExtensions Type

Contains C# and F# extension methods for the `Frame<'R, 'C>` type. The members are automatically available when you import the `Deedle` namespace. The type contains object-oriented counterparts to most of the functionality from the `Frame` module.

Data structure manipulation:

Summary 1

Input and output:

Summary 2

Missing values:

Summary 3

Table of contents

Other module members

Static members

Static member Description

FrameExtensions.Diff(frame, offset)

Full Usage: FrameExtensions.Diff(frame, offset)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - The input frame containing at least some `float` columns.
    offset : int - When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a frame with columns containing difference between an original value and a value at the specified offset. For example, calling `Frame.diff 1 s` returns a frame where previous column values is subtracted from the current ones. In pseudo-code, the function behaves as follows: result[k] = series[k] - series[k - offset] Columns that cannot be converted to `float` are left without a change.

frame : Frame<'TRowKey, 'TColumnKey>

The input frame containing at least some `float` columns.

offset : int

When positive, subtracts the past values from the current values; when negative, subtracts the future values from the current values.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.FilterRowsBy(frame, column, value)

Full Usage: FrameExtensions.FilterRowsBy(frame, column, value)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey>
    column : 'TColumnKey
    value : 'a

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey, 'a (requires equality and equality and equality)
frame : Frame<'TRowKey, 'TColumnKey>
column : 'TColumnKey
value : 'a
Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.GetRowsAt(frame, indices)

Full Usage: FrameExtensions.GetRowsAt(frame, indices)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey>
    indices : int[]

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)
frame : Frame<'TRowKey, 'TColumnKey>
indices : int[]
Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Full Usage: FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Parameters:
    series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
    lo1 : 'K1 option
    hi1 : 'K1 option
    lo2 : 'K2 option
    hi2 : 'K2 option

Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>
Type parameters: 'TRowKey1, 'TRowKey2, 'TColKey, 'K1, 'K2 (requires equality and equality and equality and equality and equality)
series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
lo1 : 'K1 option
hi1 : 'K1 option
lo2 : 'K2 option
hi2 : 'K2 option
Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>

FrameExtensions.GetSlice(series, k1, lo2, hi2)

Full Usage: FrameExtensions.GetSlice(series, k1, lo2, hi2)

Parameters:
    series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
    k1 : 'TRowKey1
    lo2 : 'TRowKey2 option
    hi2 : 'TRowKey2 option

Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>
Type parameters: 'TRowKey1, 'TRowKey2, 'TColKey (requires equality and equality and equality)
series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
k1 : 'TRowKey1
lo2 : 'TRowKey2 option
hi2 : 'TRowKey2 option
Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>

FrameExtensions.GetSlice(series, lo1, hi1, k2)

Full Usage: FrameExtensions.GetSlice(series, lo1, hi1, k2)

Parameters:
    series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
    lo1 : 'TRowKey1 option
    hi1 : 'TRowKey1 option
    k2 : 'TRowKey2

Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>
Type parameters: 'TRowKey1, 'TRowKey2, 'TColKey (requires equality and equality and equality)
series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
lo1 : 'TRowKey1 option
hi1 : 'TRowKey1 option
k2 : 'TRowKey2
Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>

FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Full Usage: FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Parameters:
    series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
    lo1 : 'TRowKey1 option
    hi1 : 'TRowKey1 option
    lo2 : 'TRowKey2 option
    hi2 : 'TRowKey2 option

Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>
Type parameters: 'TRowKey1, 'TRowKey2, 'TColKey (requires equality and equality and equality)
series : RowSeries<('TRowKey1 * 'TRowKey2), 'TColKey>
lo1 : 'TRowKey1 option
hi1 : 'TRowKey1 option
lo2 : 'TRowKey2 option
hi2 : 'TRowKey2 option
Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColKey>

FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Full Usage: FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Parameters:
    series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
    lo1 : 'K1 option
    hi1 : 'K1 option
    lo2 : 'K2 option
    hi2 : 'K2 option

Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>
Type parameters: 'TRowKey, 'TColKey1, 'TColKey2, 'K1, 'K2 (requires equality and equality and equality and equality and equality)
series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
lo1 : 'K1 option
hi1 : 'K1 option
lo2 : 'K2 option
hi2 : 'K2 option
Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>

FrameExtensions.GetSlice(series, k1, lo2, hi2)

Full Usage: FrameExtensions.GetSlice(series, k1, lo2, hi2)

Parameters:
    series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
    k1 : 'TColKey1
    lo2 : 'TColKey2 option
    hi2 : 'TColKey2 option

Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>
Type parameters: 'TRowKey, 'TColKey1, 'TColKey2 (requires equality and equality and equality)
series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
k1 : 'TColKey1
lo2 : 'TColKey2 option
hi2 : 'TColKey2 option
Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>

FrameExtensions.GetSlice(series, lo1, hi1, k2)

Full Usage: FrameExtensions.GetSlice(series, lo1, hi1, k2)

Parameters:
    series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
    lo1 : 'TColKey1 option
    hi1 : 'TColKey1 option
    k2 : 'TColKey2

Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>
Type parameters: 'TRowKey, 'TColKey1, 'TColKey2 (requires equality and equality and equality)
series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
lo1 : 'TColKey1 option
hi1 : 'TColKey1 option
k2 : 'TColKey2
Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>

FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Full Usage: FrameExtensions.GetSlice(series, lo1, hi1, lo2, hi2)

Parameters:
    series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
    lo1 : 'TColKey1 option
    hi1 : 'TColKey1 option
    lo2 : 'TColKey2 option
    hi2 : 'TColKey2 option

Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>
Type parameters: 'TRowKey, 'TColKey1, 'TColKey2 (requires equality and equality and equality)
series : ColumnSeries<'TRowKey, ('TColKey1 * 'TColKey2)>
lo1 : 'TColKey1 option
hi1 : 'TColKey1 option
lo2 : 'TColKey2 option
hi2 : 'TColKey2 option
Returns: Frame<'TRowKey, ('TColKey1 * 'TColKey2)>

FrameExtensions.Interleave(frames)

Full Usage: FrameExtensions.Interleave(frames)

Parameters:
    frames : Frame<'TRowKey, 'TColumnKey> seq - Sequence of data frames to interleave. Must be non-empty.

Returns: Frame<'TRowKey, ('TColumnKey * int)>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Combines a sequence of data frames side-by-side by tagging each frame's column keys with its 1-based position in the sequence. The result has a tuple column index of type Tuple<'TColumnKey, int>, where the integer is the 1-based source frame index. Rows are aligned using an outer join.

frames : Frame<'TRowKey, 'TColumnKey> seq

Sequence of data frames to interleave. Must be non-empty.

Returns: Frame<'TRowKey, ('TColumnKey * int)>

FrameExtensions.MapCols(frame, f)

Full Usage: FrameExtensions.MapCols(frame, f)

Parameters:
    frame : Frame<'R, 'C> - The input data frame.
    f : Func<'C, ObjectSeries<'R>, ObjectSeries<'R>> - A function called with the column key and column data series that returns the transformed column.

Returns: Frame<'R, 'C>
Type parameters: 'R, 'C (requires equality and equality)

Builds a new data frame whose columns are the results of applying the specified function to each column of the input data frame. The function receives the column key and an ObjectSeries representing the column data and must return an ObjectSeries of the same row index type.

frame : Frame<'R, 'C>

The input data frame.

f : Func<'C, ObjectSeries<'R>, ObjectSeries<'R>>

A function called with the column key and column data series that returns the transformed column.

Returns: Frame<'R, 'C>

FrameExtensions.MapRows(frame, f)

Full Usage: FrameExtensions.MapRows(frame, f)

Parameters:
    frame : Frame<'R, 'C> - The input data frame.
    f : Func<'R, ObjectSeries<'C>, 'V> - A function called with the row key and row data series that returns the mapped value.

Returns: Series<'R, 'V>
Type parameters: 'R, 'C, 'V (requires equality and equality)

Builds a new series whose values are the results of applying the specified function to each row of the data frame. The function receives the row key and an ObjectSeries representing the row data.

frame : Frame<'R, 'C>

The input data frame.

f : Func<'R, ObjectSeries<'C>, 'V>

A function called with the row key and row data series that returns the mapped value.

Returns: Series<'R, 'V>

FrameExtensions.Merge(frame, rowKey, row)

Full Usage: FrameExtensions.Merge(frame, rowKey, row)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey>
    rowKey : 'TRowKey
    row : ISeries<'TColumnKey>

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)
frame : Frame<'TRowKey, 'TColumnKey>
rowKey : 'TRowKey
row : ISeries<'TColumnKey>
Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.PctChange(frame, offset)

Full Usage: FrameExtensions.PctChange(frame, offset)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - The input frame containing at least some float columns.
    offset : int - When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a frame where each value is the percentage change relative to the value at the specified offset. For example, calling PctChange(1) returns a frame where each value represents the relative change from the previous row's value. In pseudo-code: result[k] = (frame[k] - frame[k - offset]) / frame[k - offset] Columns that cannot be converted to float are left without a change. This is commonly used in financial analysis to compute returns (e.g. daily stock returns).

frame : Frame<'TRowKey, 'TColumnKey>

The input frame containing at least some float columns.

offset : int

When positive, computes change from past values; when negative, computes change relative to future values.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.Print(frame, printTypes)

Full Usage: FrameExtensions.Print(frame, printTypes)

Parameters:
    frame : Frame<'K, 'V>
    printTypes : bool

Type parameters: 'K, 'V (requires equality and equality)
frame : Frame<'K, 'V>
printTypes : bool

FrameExtensions.Print(frame)

Full Usage: FrameExtensions.Print(frame)

Parameters:
Type parameters: 'K, 'V (requires equality and equality)
frame : Frame<'K, 'V>

FrameExtensions.Reduce(frame, aggregation)

Full Usage: FrameExtensions.Reduce(frame, aggregation)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey>
    aggregation : Func<'T, 'T, 'T>

Returns: Series<'TColumnKey, 'T>
Type parameters: 'TRowKey, 'TColumnKey, 'T (requires equality and equality)
frame : Frame<'TRowKey, 'TColumnKey>
aggregation : Func<'T, 'T, 'T>
Returns: Series<'TColumnKey, 'T>

FrameExtensions.Select(frame, projection)

Full Usage: FrameExtensions.Select(frame, projection)

Parameters:
Returns: Frame<'TRowKey, 'b>
Type parameters: 'TRowKey, 'TColumnKey, 'a, 'b (requires equality and equality and :> Deedle.ISeries<'b> and equality)
frame : Frame<'TRowKey, 'TColumnKey>
projection : Func<KeyValuePair<'TRowKey, ObjectSeries<'TColumnKey>>, int, 'a>
Returns: Frame<'TRowKey, 'b>

FrameExtensions.Select(frame, projection)

Full Usage: FrameExtensions.Select(frame, projection)

Parameters:
Returns: Frame<'TRowKey, 'b>
Type parameters: 'TRowKey, 'TColumnKey, 'a, 'b (requires equality and equality and :> Deedle.ISeries<'b> and equality)
frame : Frame<'TRowKey, 'TColumnKey>
projection : Func<KeyValuePair<'TRowKey, ObjectSeries<'TColumnKey>>, 'a>
Returns: Frame<'TRowKey, 'b>

FrameExtensions.SelectColumnKeys(frame, projection)

Full Usage: FrameExtensions.SelectColumnKeys(frame, projection)

Parameters:
Returns: Frame<'TRowKey, 'a>
Type parameters: 'TRowKey, 'TColumnKey, 'a (requires equality and equality and equality)
frame : Frame<'TRowKey, 'TColumnKey>
projection : Func<KeyValuePair<'TColumnKey, OptionalValue<ObjectSeries<'TRowKey>>>, 'a>
Returns: Frame<'TRowKey, 'a>

FrameExtensions.SelectRowKeys(frame, projection)

Full Usage: FrameExtensions.SelectRowKeys(frame, projection)

Parameters:
Returns: Frame<'a, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey, 'a (requires equality and equality and equality)
frame : Frame<'TRowKey, 'TColumnKey>
projection : Func<KeyValuePair<'TRowKey, OptionalValue<ObjectSeries<'TColumnKey>>>, 'a>
Returns: Frame<'a, 'TColumnKey>

FrameExtensions.Shift(frame, offset)

Full Usage: FrameExtensions.Shift(frame, offset)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - The input frame whose columns are to be shifted.
    offset : int - Can be both positive and negative number.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a frame with columns shifted by the specified offset. When the offset is positive, the values are shifted forward and first `offset` keys are dropped. When the offset is negative, the values are shifted backwards and the last `offset` keys are dropped. Expressed in pseudo-code: result[k] = series[k - offset]

If you want to calculate the difference, e.g. `df - (Frame.shift 1 df)`, you can use `Frame.diff` which will be a little bit faster.

frame : Frame<'TRowKey, 'TColumnKey>

The input frame whose columns are to be shifted.

offset : int

Can be both positive and negative number.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.Where(frame, condition)

Full Usage: FrameExtensions.Where(frame, condition)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - A data frame to invoke the filtering function on.
    condition : Func<KeyValuePair<'TRowKey, ObjectSeries<'TColumnKey>>, int, bool> - A delegate that specifies the filtering condition.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Filters frame rows using the specified condtion. Returns a new data frame that contains rows for which the provided function returned false. The function is called with `KeyValuePair` containing the row key as the `Key` and `Value` gives access to the row series and a row index.

frame : Frame<'TRowKey, 'TColumnKey>

A data frame to invoke the filtering function on.

condition : Func<KeyValuePair<'TRowKey, ObjectSeries<'TColumnKey>>, int, bool>

A delegate that specifies the filtering condition.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.Where(frame, condition)

Full Usage: FrameExtensions.Where(frame, condition)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - A data frame to invoke the filtering function on.
    condition : Func<KeyValuePair<'TRowKey, ObjectSeries<'TColumnKey>>, bool> - A delegate that specifies the filtering condition.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Filters frame rows using the specified condition. Returns a new data frame that contains rows for which the provided function returned false. The function is called with `KeyValuePair` containing the row key as the `Key` and `Value` gives access to the row series.

frame : Frame<'TRowKey, 'TColumnKey>

A data frame to invoke the filtering function on.

condition : Func<KeyValuePair<'TRowKey, ObjectSeries<'TColumnKey>>, bool>

A delegate that specifies the filtering condition.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.Window(frame, size, aggregate)

Full Usage: FrameExtensions.Window(frame, size, aggregate)

Parameters:
    frame : Frame<'R, 'C>
    size : int
    aggregate : Func<Frame<'R, 'C>, 'a>

Returns: Series<'R, 'a>
Type parameters: 'R, 'C, 'a (requires equality and equality)
frame : Frame<'R, 'C>
size : int
aggregate : Func<Frame<'R, 'C>, 'a>
Returns: Series<'R, 'a>

FrameExtensions.Window(frame, size)

Full Usage: FrameExtensions.Window(frame, size)

Parameters:
    frame : Frame<'R, 'C>
    size : int

Returns: Series<'R, Frame<'R, 'C>>
Type parameters: 'R, 'C (requires equality and equality)
frame : Frame<'R, 'C>
size : int
Returns: Series<'R, Frame<'R, 'C>>

Data structure manipulation

Static members

Static member Description

FrameExtensions.ExpandColumns(frame, names)

Full Usage: FrameExtensions.ExpandColumns(frame, names)

Parameters:
    frame : Frame<'R, string> - Input data frame whose columns will be expanded
    names : string seq - Names of columns in the original data frame to be expanded

Returns: Frame<'R, string>
Type parameters: 'R (requires equality)

Creates a new data frame where the specified columns are expanded based on runtime structure of the objects they store. A column can be expanded if it is Series<string, T> or IDictionary<K, V> or if it is any .NET object with readable properties.

Given a data frame with a series that contains tuples, you can expand the tuple members and get a frame with columns `S.Item1` and `S.Item2`: let df = frame [ "S" => series [ 1 => (1, "One"); 2 => (2, "Two") ] ] df.ExpandColumns ["S"]

frame : Frame<'R, string>

Input data frame whose columns will be expanded

names : string seq

Names of columns in the original data frame to be expanded

Returns: Frame<'R, string>

FrameExtensions.ExpandColumns(frame, nesting, ?dynamic)

Full Usage: FrameExtensions.ExpandColumns(frame, nesting, ?dynamic)

Parameters:
    frame : Frame<'R, string> - Input data frame to be expanded.
    nesting : int - The nesting level for expansion. When set to 0, nothing is done.
    ?dynamic : bool - Specifies whether to use dynamic expansion.

Returns: Frame<'R, string>
Type parameters: 'R (requires equality)

Creates a new data frame where all columns are expanded based on runtime structure of the objects they store. The expansion is performed recrusively to the specified depth. A column can be expanded if it is Series<string, T> or IDictionary<K, V> or if it is any .NET object with readable properties.

frame : Frame<'R, string>

Input data frame to be expanded.

nesting : int

The nesting level for expansion. When set to 0, nothing is done.

?dynamic : bool

Specifies whether to use dynamic expansion.

Returns: Frame<'R, string>

FrameExtensions.IndexColumnsWith(frame, keys)

Full Usage: FrameExtensions.IndexColumnsWith(frame, keys)

Parameters:
    frame : Frame<'R, 'C> - Source data frame whose column index are to be replaced.
    keys : 'TNewRowIndex seq - A collection of new column keys.

Returns: Frame<'R, 'TNewRowIndex>
Type parameters: 'R, 'C, 'TNewRowIndex (requires equality and equality and equality)

Replace the column index of the frame with the provided sequence of column keys. The columns of the frame are assigned keys according to the current order, or in a non-deterministic way, if the current column index is not ordered.

frame : Frame<'R, 'C>

Source data frame whose column index are to be replaced.

keys : 'TNewRowIndex seq

A collection of new column keys.

Returns: Frame<'R, 'TNewRowIndex>

FrameExtensions.IndexRowsApply(frame, column, f)

Full Usage: FrameExtensions.IndexRowsApply(frame, column, f)

Parameters:
    frame : Frame<'R, 'C> - Source data frame whose row index is to be replaced.
    column : 'C - The name of the column to use as the new index.
    f : Func<'V, 'R2> - A function that converts each column value to the desired row key type.

Returns: Frame<'R2, 'C>
Type parameters: 'R, 'C, 'V, 'R2 (requires equality and equality and equality and equality)

Returns a data frame whose rows are indexed based on the specified column of the original data frame, with each index value transformed by the given function. The specified column is removed from the resulting frame.

frame : Frame<'R, 'C>

Source data frame whose row index is to be replaced.

column : 'C

The name of the column to use as the new index.

f : Func<'V, 'R2>

A function that converts each column value to the desired row key type.

Returns: Frame<'R2, 'C>

FrameExtensions.IndexRowsOrdinally(frame)

Full Usage: FrameExtensions.IndexRowsOrdinally(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame whose row index are to be replaced.

Returns: Frame<int, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Replace the row index of the frame with ordinarilly generated integers starting from zero. The rows of the frame are assigned index according to the current order, or in a non-deterministic way, if the current row index is not ordered.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame whose row index are to be replaced.

Returns: Frame<int, 'TColumnKey>

FrameExtensions.IndexRowsUsing(frame, f)

Full Usage: FrameExtensions.IndexRowsUsing(frame, f)

Parameters:
    frame : Frame<'R, 'C> - Source data frame whose row index are to be replaced.
    f : Func<ObjectSeries<'C>, 'R2> - A function from row (as object series) to new row key value

Returns: Frame<'R2, 'C>
Type parameters: 'R, 'C, 'R2 (requires equality and equality and equality)

Replace the row index of the frame with a sequence of row keys generated using a function invoked on each row.

frame : Frame<'R, 'C>

Source data frame whose row index are to be replaced.

f : Func<ObjectSeries<'C>, 'R2>

A function from row (as object series) to new row key value

Returns: Frame<'R2, 'C>

FrameExtensions.IndexRowsWith(frame, keys)

Full Usage: FrameExtensions.IndexRowsWith(frame, keys)

Parameters:
    frame : Frame<'R, 'C> - Source data frame whose row index are to be replaced.
    keys : 'TNewRowIndex seq - A collection of new row keys.

Returns: Frame<'TNewRowIndex, 'C>
Type parameters: 'R, 'C, 'TNewRowIndex (requires equality and equality and equality)

Replace the row index of the frame with the provided sequence of row keys. The rows of the frame are assigned keys according to the current order, or in a non-deterministic way, if the current row index is not ordered.

frame : Frame<'R, 'C>

Source data frame whose row index are to be replaced.

keys : 'TNewRowIndex seq

A collection of new row keys.

Returns: Frame<'TNewRowIndex, 'C>

FrameExtensions.MeltBy(frame, idColumns)

Full Usage: FrameExtensions.MeltBy(frame, idColumns)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - The input data frame to melt.
    idColumns : 'TColumnKey[] - Columns to keep as identity columns. All other columns are melted.

Returns: Frame<int, string>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Unpivots a data frame from wide format to long format, similar to pandas DataFrame.melt. The specified identity columns are kept as-is; all other columns are collapsed into two new columns: "Column" holding the original column key and "Value" holding the cell value. Rows with missing values in the value columns are dropped.

frame : Frame<'TRowKey, 'TColumnKey>

The input data frame to melt.

idColumns : 'TColumnKey[]

Columns to keep as identity columns. All other columns are melted.

Returns: Frame<int, string>

FrameExtensions.Nest(frame)

Full Usage: FrameExtensions.Nest(frame)

Parameters:
    frame : Frame<('TRowKey1 * 'TRowKey2), 'TColumnKey>

Returns: Series<'TRowKey1, Frame<'TRowKey2, 'TColumnKey>>
Type parameters: 'TRowKey1, 'TRowKey2, 'TColumnKey (requires equality and equality and equality)

Given a data frame whose row index has two levels, create a series whose keys are the unique first level keys, and whose values are those corresponding frames selected from the original data.

frame : Frame<('TRowKey1 * 'TRowKey2), 'TColumnKey>
Returns: Series<'TRowKey1, Frame<'TRowKey2, 'TColumnKey>>

FrameExtensions.NestBy(frame, keyselector)

Full Usage: FrameExtensions.NestBy(frame, keyselector)

Parameters:
    frame : Frame<'TRowKey1, 'TColumnKey>
    keyselector : Func<'TRowKey1, 'TRowKey2>

Returns: Series<'TRowKey2, Frame<'TRowKey1, 'TColumnKey>>
Type parameters: 'TRowKey1, 'TColumnKey, 'TRowKey2 (requires equality and equality and equality)

Given a data frame whose row index has two levels, create a series whose keys are the unique results of the keyselector projection, and whose values are those corresponding frames selected from the original data.

frame : Frame<'TRowKey1, 'TColumnKey>
keyselector : Func<'TRowKey1, 'TRowKey2>
Returns: Series<'TRowKey2, Frame<'TRowKey1, 'TColumnKey>>

FrameExtensions.NestRowsBy(frame, groupSelector, rowSelector)

Full Usage: FrameExtensions.NestRowsBy(frame, groupSelector, rowSelector)

Parameters:
    frame : Frame<'TRowKey1, 'TColumnKey>
    groupSelector : Func<'TRowKey1, 'TGroupKey>
    rowSelector : Func<'TRowKey1, 'TRowKey2>

Returns: Series<'TGroupKey, Frame<'TRowKey2, 'TColumnKey>>
Type parameters: 'TRowKey1, 'TColumnKey, 'TGroupKey, 'TRowKey2 (requires equality and equality and equality and equality)

Given a data frame, groups rows by groupSelector and produces a series whose keys are the distinct group keys and whose values are sub-frames re-indexed by rowSelector. This is a generalisation of NestBy that lets you transform the inner row keys independently of the group keys.

frame : Frame<'TRowKey1, 'TColumnKey>
groupSelector : Func<'TRowKey1, 'TGroupKey>
rowSelector : Func<'TRowKey1, 'TRowKey2>
Returns: Series<'TGroupKey, Frame<'TRowKey2, 'TColumnKey>>

FrameExtensions.RankRowsBy(frame, key)

Full Usage: FrameExtensions.RankRowsBy(frame, key)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame.
    key : 'TColumnKey - The column key to rank by.

Returns: Series<'TRowKey, int>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a series containing the dense rank of each row in the data frame, based on values in the specified column. The rank is 1-based: the row with the smallest column value receives rank 1. Rows with equal values receive the same rank. Rows where the column has a missing value receive a missing rank.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame.

key : 'TColumnKey

The column key to rank by.

Returns: Series<'TRowKey, int>

FrameExtensions.RealignRows(frame, keys)

Full Usage: FrameExtensions.RealignRows(frame, keys)

Parameters:
    frame : Frame<'R, 'C> - Source data frame that is to be realigned.
    keys : 'R seq - A sequence of new row keys. The keys must have the same type as the original frame keys (because the rows are realigned).

Returns: Frame<'R, 'C>
Type parameters: 'R, 'C (requires equality and equality)

Align the existing data to a specified collection of row keys. Values in the data frame that do not match any new key are dropped, new keys (that were not in the original data frame) are assigned missing values.

frame : Frame<'R, 'C>

Source data frame that is to be realigned.

keys : 'R seq

A sequence of new row keys. The keys must have the same type as the original frame keys (because the rows are realigned).

Returns: Frame<'R, 'C>

FrameExtensions.SortColumnsByKey(frame)

Full Usage: FrameExtensions.SortColumnsByKey(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame to be ordered.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a data frame that contains the same data as the input, but whose columns are an ordered series. This allows using operations that are only available on indexed series such as alignment and inexact lookup.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame to be ordered.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.SortRows(frame, key)

Full Usage: FrameExtensions.SortRows(frame, key)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame to be ordered.
    key : 'TColumnKey - The column key to sort by.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a data frame that contains the same data as the input, but whose rows are sorted by some column.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame to be ordered.

key : 'TColumnKey

The column key to sort by.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.SortRowsBy(frame, key, f)

Full Usage: FrameExtensions.SortRowsBy(frame, key, f)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame to be ordered.
    key : 'TColumnKey - The column key to sort by.
    f : Func<'V, 'V2> - A function to transform values before comparison.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey, 'V, 'V2 (requires equality and equality and comparison)

Returns a data frame that contains the same data as the input, but whose rows are sorted by some column.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame to be ordered.

key : 'TColumnKey

The column key to sort by.

f : Func<'V, 'V2>

A function to transform values before comparison.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.SortRowsByKey(frame)

Full Usage: FrameExtensions.SortRowsByKey(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame to be ordered.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a data frame that contains the same data as the input, but whose rows are an ordered series. This allows using operations that are only available on indexed series such as alignment and inexact lookup.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame to be ordered.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.SortRowsWith(frame, key, cmp)

Full Usage: FrameExtensions.SortRowsWith(frame, key, cmp)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame to be ordered.
    key : 'TColumnKey - The column key to sort by.
    cmp : Comparer<'V> - The comparer to use for sorting values.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey, 'V (requires equality and equality)

Returns a data frame that contains the same data as the input, but whose rows are sorted by some column.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame to be ordered.

key : 'TColumnKey

The column key to sort by.

cmp : Comparer<'V>

The comparer to use for sorting values.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.Stack(frame)

Full Usage: FrameExtensions.Stack(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - The input data frame to convert to long format.

Returns: Frame<('TRowKey * 'TColumnKey), string>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Converts a data frame to a long-format frame by combining the row index and the column index into a 2-tuple row index. Each cell of the original frame becomes a row in the result keyed by (rowKey, columnKey), with a single column named "Value". Missing values are dropped.

This is the pandas-style DataFrame.stack() operation. The inverse operation is Unstack.

frame : Frame<'TRowKey, 'TColumnKey>

The input data frame to convert to long format.

Returns: Frame<('TRowKey * 'TColumnKey), string>

FrameExtensions.Transpose(frame)

Full Usage: FrameExtensions.Transpose(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame to be transposed.

Returns: Frame<'TColumnKey, 'TRowKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a transposed data frame. The rows of the original data frame are used as the columns of the new one (and vice versa). Use this operation if you have a data frame and you mostly need to access its rows as a series (because accessing columns as a series is more efficient).

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame to be transposed.

Returns: Frame<'TColumnKey, 'TRowKey>

FrameExtensions.Unnest(series)

Full Usage: FrameExtensions.Unnest(series)

Parameters:
    series : Series<'TRowKey1, Frame<'TRowKey2, 'TColumnKey>>

Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColumnKey>
Type parameters: 'TRowKey1, 'TRowKey2, 'TColumnKey (requires equality and equality and equality)

Given a series whose values are frames, create a frame resulting from the concatenation of all the frames' rows, with the resulting keys having two levels. This is the inverse operation to nest.

series : Series<'TRowKey1, Frame<'TRowKey2, 'TColumnKey>>
Returns: Frame<('TRowKey1 * 'TRowKey2), 'TColumnKey>

FrameExtensions.Unstack(frame)

Full Usage: FrameExtensions.Unstack(frame)

Parameters:
    frame : Frame<('TRowKey1 * 'TRowKey2), 'TColumnKey> - The input data frame with a 2-tuple row index.

Returns: Frame<'TRowKey1, ('TColumnKey * 'TRowKey2)>
Type parameters: 'TRowKey1, 'TRowKey2, 'TColumnKey (requires equality and equality and equality)

Converts a data frame with a 2-tuple row index into a wide-format frame by promoting the inner (second) element of each row key to the column index. The resulting frame has row keys equal to the unique first tuple elements and column keys of the form (originalColumnKey, innerRowKey). Cells with no corresponding entry in the input are represented as missing values.

This is the pandas-style DataFrame.unstack() operation and is the inverse of Stack (modulo column-key wrapping when the input has more than one column).

frame : Frame<('TRowKey1 * 'TRowKey2), 'TColumnKey>

The input data frame with a 2-tuple row index.

Returns: Frame<'TRowKey1, ('TColumnKey * 'TRowKey2)>

Fancy accessors

Static members

Static member Description

FrameExtensions.GetRows(frame, rowKeys)

Full Usage: FrameExtensions.GetRows(frame, rowKeys)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey>
    rowKeys : 'TRowKey[]

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)
frame : Frame<'TRowKey, 'TColumnKey>
rowKeys : 'TRowKey[]
Returns: Frame<'TRowKey, 'TColumnKey>

Frame operations

Static members

Static member Description

FrameExtensions.PivotTable(frame, r, c, op)

Full Usage: FrameExtensions.PivotTable(frame, r, c, op)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to pivot.
    r : 'C - A column key to group on for the resulting row index
    c : 'C - A column key to group on for the resulting col index
    op : Func<Frame<'R, 'C>, 'T> - A function computing a value from the corresponding bucket frame

Returns: Frame<'RNew, 'CNew>
Type parameters: 'R, 'C, 'RNew, 'CNew, 'T (requires equality and equality and equality and equality)

Creates a new data frame resulting from a 'pivot' operation. Consider a denormalized data frame representing a table: column labels are field names & table values are observations of those fields. pivotTable buckets the rows along two axes, according to the values of the columns `r` and `c`; and then computes a value for the frame of rows that land in each bucket.

frame : Frame<'R, 'C>

The input data frame to pivot.

r : 'C

A column key to group on for the resulting row index

c : 'C

A column key to group on for the resulting col index

op : Func<Frame<'R, 'C>, 'T>

A function computing a value from the corresponding bucket frame

Returns: Frame<'RNew, 'CNew>

Frame transformations

Static members

Static member Description

FrameExtensions.DistinctRowsBy(frame, columns)

Full Usage: FrameExtensions.DistinctRowsBy(frame, columns)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Input data frame to be filtered.
    columns : 'TColumnKey[] - An array of column keys used to determine row uniqueness.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a new data frame containing only the rows that have distinct values in the specified columns. When multiple rows have the same values in those columns, only the first row (in index order) is preserved.

frame : Frame<'TRowKey, 'TColumnKey>

Input data frame to be filtered.

columns : 'TColumnKey[]

An array of column keys used to determine row uniqueness.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.WhereColsByMask(frame, mask)

Full Usage: FrameExtensions.WhereColsByMask(frame, mask)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Input data frame to be filtered.
    mask : Series<'TColumnKey, bool> - A series of boolean values indexed by the column key type.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a new data frame containing only the columns of the input frame whose corresponding value in the boolean mask series is true. Columns whose key is missing from the mask are excluded. This enables pandas-style boolean indexing.

frame : Frame<'TRowKey, 'TColumnKey>

Input data frame to be filtered.

mask : Series<'TColumnKey, bool>

A series of boolean values indexed by the column key type.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.WhereRowsByMask(frame, mask)

Full Usage: FrameExtensions.WhereRowsByMask(frame, mask)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Input data frame to be filtered.
    mask : Series<'TRowKey, bool> - A series of boolean values indexed by the row key type.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a new data frame containing only the rows of the input frame whose corresponding value in the boolean mask series is true. Rows whose key is missing from the mask are excluded. This enables pandas-style boolean indexing.

frame : Frame<'TRowKey, 'TColumnKey>

Input data frame to be filtered.

mask : Series<'TRowKey, bool>

A series of boolean values indexed by the row key type.

Returns: Frame<'TRowKey, 'TColumnKey>

Input and output

Static members

Static member Description

FrameExtensions.SaveCsv(frame, path, keyNames, ?separator, ?culture)

Full Usage: FrameExtensions.SaveCsv(frame, path, keyNames, ?separator, ?culture)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to be saved.
    path : string - Specifies the output file name where the CSV data should be written
    keyNames : string seq - Specifies the CSV headers for row key (or keys, for multi-level index)
    ?separator : char - Specify the column separator in the file (the default is `\t` for TSV files and `,` for CSV files)
    ?culture : CultureInfo - Specify the `CultureInfo` object used for formatting numerical data

Type parameters: 'R, 'C (requires equality and equality)

Save data frame to a CSV file or to a `Stream`. When calling the operation, you can specify whether you want to save the row keys or not (and headers for the keys) and you can also specify the separator (use `\t` for writing TSV files). When specifying file name ending with `.tsv`, the `\t` separator is used automatically.

frame : Frame<'R, 'C>

The input data frame to be saved.

path : string

Specifies the output file name where the CSV data should be written

keyNames : string seq

Specifies the CSV headers for row key (or keys, for multi-level index)

?separator : char

Specify the column separator in the file (the default is `\t` for TSV files and `,` for CSV files)

?culture : CultureInfo

Specify the `CultureInfo` object used for formatting numerical data

FrameExtensions.SaveCsv(frame, path, ?includeRowKeys, ?keyNames, ?separator, ?culture)

Full Usage: FrameExtensions.SaveCsv(frame, path, ?includeRowKeys, ?keyNames, ?separator, ?culture)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to be saved.
    path : string - Specifies the output file name where the CSV data should be written
    ?includeRowKeys : bool - When set to `true`, the row key is also written to the output file
    ?keyNames : string - Can be used to specify the CSV headers for row key (or keys, for multi-level index)
    ?separator : char - Specify the column separator in the file (the default is `\t` for TSV files and `,` for CSV files)
    ?culture : CultureInfo - Specify the `CultureInfo` object used for formatting numerical data

Type parameters: 'R, 'C (requires equality and equality)

Save data frame to a CSV file or to a `Stream`. When calling the operation, you can specify whether you want to save the row keys or not (and headers for the keys) and you can also specify the separator (use `\t` for writing TSV files). When specifying file name ending with `.tsv`, the `\t` separator is used automatically.

frame : Frame<'R, 'C>

The input data frame to be saved.

path : string

Specifies the output file name where the CSV data should be written

?includeRowKeys : bool

When set to `true`, the row key is also written to the output file

?keyNames : string

Can be used to specify the CSV headers for row key (or keys, for multi-level index)

?separator : char

Specify the column separator in the file (the default is `\t` for TSV files and `,` for CSV files)

?culture : CultureInfo

Specify the `CultureInfo` object used for formatting numerical data

FrameExtensions.SaveCsv(frame, writer, ?includeRowKeys, ?keyNames, ?separator, ?culture)

Full Usage: FrameExtensions.SaveCsv(frame, writer, ?includeRowKeys, ?keyNames, ?separator, ?culture)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to be saved.
    writer : TextWriter - Specifies the text writer to which the CSV data should be written
    ?includeRowKeys : bool - When set to `true`, the row key is also written to the output file
    ?keyNames : string - Can be used to specify the CSV headers for row key (or keys, for multi-level index)
    ?separator : char - Specify the column separator in the file (the default is `\t` for TSV files and `,` for CSV files)
    ?culture : CultureInfo - Specify the `CultureInfo` object used for formatting numerical data

Type parameters: 'R, 'C (requires equality and equality)

Save data frame to a CSV file or to a `Stream`. When calling the operation, you can specify whether you want to save the row keys or not (and headers for the keys) and you can also specify the separator (use `\t` for writing TSV files). When specifying file name ending with `.tsv`, the `\t` separator is used automatically.

frame : Frame<'R, 'C>

The input data frame to be saved.

writer : TextWriter

Specifies the text writer to which the CSV data should be written

?includeRowKeys : bool

When set to `true`, the row key is also written to the output file

?keyNames : string

Can be used to specify the CSV headers for row key (or keys, for multi-level index)

?separator : char

Specify the column separator in the file (the default is `\t` for TSV files and `,` for CSV files)

?culture : CultureInfo

Specify the `CultureInfo` object used for formatting numerical data

FrameExtensions.SaveJson(frame, path, ?orient)

Full Usage: FrameExtensions.SaveJson(frame, path, ?orient)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to serialize.
    path : string - The output file path.
    ?orient : string - Controls the JSON layout (see ToJson).

Type parameters: 'R, 'C (requires equality and equality)

Save the data frame as a JSON file at the specified path.

frame : Frame<'R, 'C>

The input data frame to serialize.

path : string

The output file path.

?orient : string

Controls the JSON layout (see ToJson).

FrameExtensions.SaveJson(frame, writer, ?orient)

Full Usage: FrameExtensions.SaveJson(frame, writer, ?orient)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to serialize.
    writer : TextWriter - The TextWriter to write JSON to.
    ?orient : string - Controls the JSON layout (see ToJson).

Type parameters: 'R, 'C (requires equality and equality)

Save the data frame as JSON to the specified TextWriter.

frame : Frame<'R, 'C>

The input data frame to serialize.

writer : TextWriter

The TextWriter to write JSON to.

?orient : string

Controls the JSON layout (see ToJson).

FrameExtensions.ToDataTable(frame, rowKeyNames)

Full Usage: FrameExtensions.ToDataTable(frame, rowKeyNames)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to be converted.
    rowKeyNames : string seq - Specifies the names of the row key components (or just a single row key name if the row index is not hierarchical).

Returns: DataTable
Type parameters: 'R, 'C (requires equality and equality)

Returns the data of the frame as a .NET `DataTable` object. The column keys are automatically converted to strings that are used as column names. The row index is turned into an additional column with the specified name (the function takes the name as a sequence to support hierarchical keys, but typically you can write just `frame.ToDataTable(["KeyName"])`.

frame : Frame<'R, 'C>

The input data frame to be converted.

rowKeyNames : string seq

Specifies the names of the row key components (or just a single row key name if the row index is not hierarchical).

Returns: DataTable

FrameExtensions.ToJson(frame, ?orient)

Full Usage: FrameExtensions.ToJson(frame, ?orient)

Parameters:
    frame : Frame<'R, 'C> - The input data frame to serialize.
    ?orient : string - Controls the JSON layout. Allowed values: "columns" (default) — column-major {"col":{"row":v}}; "index" — row-major {"row":{"col":v}}; "records" — array of row objects [{"col":v}].

Returns: string
Type parameters: 'R, 'C (requires equality and equality)

Serialize the data frame to a JSON string.

frame : Frame<'R, 'C>

The input data frame to serialize.

?orient : string

Controls the JSON layout. Allowed values: "columns" (default) — column-major {"col":{"row":v}}; "index" — row-major {"row":{"col":v}}; "records" — array of row objects [{"col":v}].

Returns: string

Joining, merging and zipping

Static members

Static member Description

FrameExtensions.Compare(frame, other)

Full Usage: FrameExtensions.Compare(frame, other)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - The first (original) frame.
    other : Frame<'TRowKey, 'TColumnKey> - The second (updated) frame to compare against.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Compares two data frames column-by-column and returns a new frame of Diff values. Each cell describes whether the value was added, removed, or changed between the two frames. Columns present only in this frame contribute Diff.Remove values; columns present only in other contribute Diff.Add values; columns present in both are compared element-wise.

frame : Frame<'TRowKey, 'TColumnKey>

The first (original) frame.

other : Frame<'TRowKey, 'TColumnKey>

The second (updated) frame to compare against.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.JoinOn(frame, other, kind, colKey)

Full Usage: FrameExtensions.JoinOn(frame, other, kind, colKey)

Parameters:
    frame : Frame<'TRowKey1, 'TColumnKey> - First (left) data frame.
    other : Frame<'TRowKey2, 'TColumnKey> - Second (right) data frame to join with.
    kind : JoinKind - Specifies the join kind (Outer, Inner, Left, Right).
    colKey : 'TColumnKey - The name of the column to join on. Must exist in both frames.

Returns: Frame<'K, 'TColumnKey>
Type parameters: 'TRowKey1, 'TColumnKey, 'TRowKey2, 'K (requires equality and equality and equality and equality)

Join two data frames on a shared column, using that column's values as the row index for alignment. Both frames must have unique values in the specified column. The join column is removed from the data columns of the result and becomes the row index.

frame : Frame<'TRowKey1, 'TColumnKey>

First (left) data frame.

other : Frame<'TRowKey2, 'TColumnKey>

Second (right) data frame to join with.

kind : JoinKind

Specifies the join kind (Outer, Inner, Left, Right).

colKey : 'TColumnKey

The name of the column to join on. Must exist in both frames.

Returns: Frame<'K, 'TColumnKey>

FrameExtensions.JoinOnInt(frame, other, kind, colKey)

Full Usage: FrameExtensions.JoinOnInt(frame, other, kind, colKey)

Parameters:
    frame : Frame<'TRowKey1, 'TColumnKey> - First (left) data frame.
    other : Frame<'TRowKey2, 'TColumnKey> - Second (right) data frame to join with.
    kind : JoinKind - Specifies the join kind (Outer, Inner, Left, Right).
    colKey : 'TColumnKey - The name of the column to join on.

Returns: Frame<int, 'TColumnKey>
Type parameters: 'TRowKey1, 'TColumnKey, 'TRowKey2 (requires equality and equality and equality)

Join two data frames on a shared int-valued column. Both frames must have unique values in the specified column. The join column becomes the row index of the result frame.

frame : Frame<'TRowKey1, 'TColumnKey>

First (left) data frame.

other : Frame<'TRowKey2, 'TColumnKey>

Second (right) data frame to join with.

kind : JoinKind

Specifies the join kind (Outer, Inner, Left, Right).

colKey : 'TColumnKey

The name of the column to join on.

Returns: Frame<int, 'TColumnKey>

FrameExtensions.JoinOnString(frame, other, kind, colKey)

Full Usage: FrameExtensions.JoinOnString(frame, other, kind, colKey)

Parameters:
    frame : Frame<'TRowKey1, 'TColumnKey> - First (left) data frame.
    other : Frame<'TRowKey2, 'TColumnKey> - Second (right) data frame to join with.
    kind : JoinKind - Specifies the join kind (Outer, Inner, Left, Right).
    colKey : 'TColumnKey - The name of the column to join on.

Returns: Frame<string, 'TColumnKey>
Type parameters: 'TRowKey1, 'TColumnKey, 'TRowKey2 (requires equality and equality and equality)

Join two data frames on a shared string-valued column. Both frames must have unique values in the specified column. The join column becomes the row index of the result frame.

frame : Frame<'TRowKey1, 'TColumnKey>

First (left) data frame.

other : Frame<'TRowKey2, 'TColumnKey>

Second (right) data frame to join with.

kind : JoinKind

Specifies the join kind (Outer, Inner, Left, Right).

colKey : 'TColumnKey

The name of the column to join on.

Returns: Frame<string, 'TColumnKey>

Missing values

Static members

Static member Description

FrameExtensions.DropEmptyColumns(frame)

Full Usage: FrameExtensions.DropEmptyColumns(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Creates a new data frame that drops those columns that are empty for each row. The resulting data frame has the same number of rows, but may have fewer columns (or no columns at all).

frame : Frame<'TRowKey, 'TColumnKey>

An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.DropEmptyRows(frame)

Full Usage: FrameExtensions.DropEmptyRows(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Creates a new data frame that contains only those rows that are empty for each column. The resulting data frame has the same number of columns, but may have fewer rows (or no rows at all).

frame : Frame<'TRowKey, 'TColumnKey>

An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.DropSparseColumns(frame)

Full Usage: FrameExtensions.DropSparseColumns(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Creates a new data frame that contains only those columns of the original data frame that are _dense_, meaning that they have a value for each row. The resulting data frame has the same number of rows, but may have fewer columns (or no columns at all).

frame : Frame<'TRowKey, 'TColumnKey>

An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.DropSparseRows(frame)

Full Usage: FrameExtensions.DropSparseRows(frame)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Creates a new data frame that contains only those rows of the original data frame that are _dense_, meaning that they have a value for each column. The resulting data frame has the same number of columns, but may have fewer rows (or no rows at all).

frame : Frame<'TRowKey, 'TColumnKey>

An input data frame that is to be filtered

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.FillMissing(frame, f)

Full Usage: FrameExtensions.FillMissing(frame, f)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - An input data frame that is to be filled
    f : Func<Series<'TRowKey, 'T>, 'TRowKey, 'T> - A function that takes a series Series<R, T> together with a key K in the series and generates a value to be used in a place where the original series contains a missing value.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey, 'T (requires equality and equality)

Fill missing values in the frame using the specified function. The specified function is called with all series and keys for which the frame does not contain value and the result of the call is used in place of the missing value. The operation is only applied to columns (series) that contain values of the same type as the return type of the provided filling function. The operation does not attempt to convert between numeric values (so a series containing `float` will not be converted to a series of `int`).

frame : Frame<'TRowKey, 'TColumnKey>

An input data frame that is to be filled

f : Func<Series<'TRowKey, 'T>, 'TRowKey, 'T>

A function that takes a series Series<R, T> together with a key K in the series and generates a value to be used in a place where the original series contains a missing value.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.FillMissing(frame, direction)

Full Usage: FrameExtensions.FillMissing(frame, direction)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - An input data frame that is to be filled
    direction : Direction - Specifies the direction used when searching for the nearest available value. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Fill missing values in the data frame with the nearest available value (using the specified direction). Note that the frame may still contain missing values after call to this function (e.g. if the first value is not available and we attempt to fill series with previous values). This operation can only be used on ordered frames.

frame : Frame<'TRowKey, 'TColumnKey>

An input data frame that is to be filled

direction : Direction

Specifies the direction used when searching for the nearest available value. `Backward` means that we want to look for the first value with a smaller key while `Forward` searches for the nearest greater key.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.FillMissing(frame, value)

Full Usage: FrameExtensions.FillMissing(frame, value)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - An input data frame that is to be filled
    value : 'T - A constant value that is used to fill all missing values

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey, 'T (requires equality and equality)

Fill missing values of a given type in the frame with a constant value. The operation is only applied to columns (series) that contain values of the same type as the provided filling value. The operation does not attempt to convert between numeric values (so a series containing `float` will not be converted to a series of `int`).

frame : Frame<'TRowKey, 'TColumnKey>

An input data frame that is to be filled

value : 'T

A constant value that is used to fill all missing values

Returns: Frame<'TRowKey, 'TColumnKey>

Sorting and index manipulation

Static members

Static member Description

FrameExtensions.RenameColumn(frame, oldKey, newKey)

Full Usage: FrameExtensions.RenameColumn(frame, oldKey, newKey)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame.
    oldKey : 'TColumnKey - The current key of the column to rename.
    newKey : 'TColumnKey - The new key to assign to that column.

Returns: Frame<'TRowKey, 'TColumnKey>
Type parameters: 'TRowKey, 'TColumnKey (requires equality and equality)

Returns a new data frame where the specified column has been renamed to the new key. If oldKey is not found, the frame is returned unchanged.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame.

oldKey : 'TColumnKey

The current key of the column to rename.

newKey : 'TColumnKey

The new key to assign to that column.

Returns: Frame<'TRowKey, 'TColumnKey>

FrameExtensions.RenameColumns(frame, mapping)

Full Usage: FrameExtensions.RenameColumns(frame, mapping)

Parameters:
    frame : Frame<'TRowKey, 'TColumnKey> - Source data frame.
    mapping : Func<'TColumnKey, 'TColumnKey2> - A function that maps each current column key to a new column key.

Returns: Frame<'TRowKey, 'TColumnKey2>
Type parameters: 'TRowKey, 'TColumnKey, 'TColumnKey2 (requires equality and equality and equality)

Returns a new data frame where all column keys have been transformed by the specified mapping function.

frame : Frame<'TRowKey, 'TColumnKey>

Source data frame.

mapping : Func<'TColumnKey, 'TColumnKey2>

A function that maps each current column key to a new column key.

Returns: Frame<'TRowKey, 'TColumnKey2>

Type something to start searching.