F# Frame extensions Class |
Namespace: Deedle
public static class F# Frame extensions
The F# Frame extensions type exposes the following members.
Name | Description | |
---|---|---|
framea, b, c |
A function for constructing data frame from a sequence of name - column pairs.
This provides a nicer syntactic sugar for `Frame.ofColumns`.
## Example
To create a simple frame with two columns, you can write:
frame [ "A" => series [ 1 => 30.0; 2 => 35.0 ]
"B" => series [ 1 => 30.0; 3 => 40.0 ] ]
[category:Frame construction]
| |
PivotTableTRowKey, TColumnKey, R, C, T |
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.
## Parameters
- `r` - A column key to group on for the resulting row index
- `c` - A column key to group on for the resulting col index
- `op` - A function computing a value from the corresponding bucket frame
[category:Frame operations]
| |
SaveCsvTRowKey, TColumnKey(FrameTRowKey, TColumnKey, String, IEnumerableString) |
Save data frame to a CSV file or to a `TextWriter`. 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.
## Parameters
- `path` - Specifies the output file name where the CSV data should be written
- `keyNames` - Specifies the CSV headers for row key (or keys, for multi-level index)
- `separator` - Specify the column separator in the file (the default is `\t` for
TSV files and `,` for CSV files)
- `culture` - Specify the `CultureInfo` object used for formatting numerical data
[category:Input and output]
| |
SaveCsvTRowKey, TColumnKey(FrameTRowKey, TColumnKey, Stream, FSharpOptionBoolean, FSharpOptionIEnumerableString, FSharpOptionChar, FSharpOptionCultureInfo) | Obsolete.
[omit]
| |
SaveCsvTRowKey, TColumnKey(FrameTRowKey, TColumnKey, TextWriter, FSharpOptionBoolean, FSharpOptionIEnumerableString, FSharpOptionChar, FSharpOptionCultureInfo) |
Save data frame to a CSV file or a `TextWriter`. 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.
## Parameters
- `writer` - Specifies the TextWriter to which the CSV data should be written
- `includeRowKeys` - When set to `true`, the row key is also written to the output file
- `keyNames` - Can be used to specify the CSV headers for row key (or keys, for multi-level index)
- `separator` - Specify the column separator in the file (the default is `\t` for
TSV files and `,` for CSV files)
- `culture` - Specify the `CultureInfo` object used for formatting numerical data
[category:Input and output]
| |
SaveCsvTRowKey, TColumnKey(FrameTRowKey, TColumnKey, String, FSharpOptionBoolean, FSharpOptionIEnumerableString, FSharpOptionChar, FSharpOptionCultureInfo) |
Save data frame to a CSV file or a `TextWriter`. 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.
## Parameters
- `path` - Specifies the output file name where the CSV data should be written
- `includeRowKeys` - When set to `true`, the row key is also written to the output file
- `keyNames` - Can be used to specify the CSV headers for row key (or keys, for multi-level index)
- `separator` - Specify the column separator in the file (the default is `\t` for
TSV files and `,` for CSV files)
- `culture` - Specify the `CultureInfo` object used for formatting numerical data
[category:Input and output]
| |
Static(Stream, FSharpOptionBoolean, FSharpOptionBoolean, FSharpOptionInt32, FSharpOptionString, FSharpOptionString, FSharpOptionString, FSharpOptionInt32, FSharpOptionString) |
Load data frame from a CSV file. The operation automatically reads column names from the
CSV file (if they are present) and infers the type of values for each column. Columns
of primitive types (`int`, `float`, etc.) are converted to the right type. Columns of other
types (such as dates) are not converted automatically.
## Parameters
* `stream` - Specifies the input stream, opened at the beginning of CSV data
* `hasHeaders` - Specifies whether the input CSV file has header row
* `inferTypes` - Specifies whether the method should attempt to infer types
of columns automatically (set this to `false` if you want to specify schema)
* `inferRows` - If `inferTypes=true`, this parameter specifies the number of
rows to use for type inference. The default value is 100.
* `schema` - A string that specifies CSV schema. See the documentation for
information about the schema format.
* `separators` - A string that specifies one or more (single character) separators
that are used to separate columns in the CSV file. Use for example `";"` to
parse semicolon separated files.
* `culture` - Specifies the name of the culture that is used when parsing
values in the CSV file (such as `"en-US"`). The default is invariant culture.
* `maxRows` - The maximal number of rows that should be read from the CSV file.
* `missingValues` - An array of strings that contains values which should be treated
as missing when reading the file. The default value is: "NaN"; "NA"; "#N/A"; ":"; "-"; "TBA"; "TBD".
[category:Input and output]
| |
Static(TextReader, FSharpOptionBoolean, FSharpOptionBoolean, FSharpOptionInt32, FSharpOptionString, FSharpOptionString, FSharpOptionString, FSharpOptionInt32, FSharpOptionString) |
Load data frame from a CSV file. The operation automatically reads column names from the
CSV file (if they are present) and infers the type of values for each column. Columns
of primitive types (`int`, `float`, etc.) are converted to the right type. Columns of other
types (such as dates) are not converted automatically.
## Parameters
* `reader` - Specifies the `TextReader`, positioned at the beginning of CSV data
* `hasHeaders` - Specifies whether the input CSV file has header row
* `inferTypes` - Specifies whether the method should attempt to infer types
of columns automatically (set this to `false` if you want to specify schema)
* `inferRows` - If `inferTypes=true`, this parameter specifies the number of
rows to use for type inference. The default value is 100.
* `schema` - A string that specifies CSV schema. See the documentation for
information about the schema format.
* `separators` - A string that specifies one or more (single character) separators
that are used to separate columns in the CSV file. Use for example `";"` to
parse semicolon separated files.
* `culture` - Specifies the name of the culture that is used when parsing
values in the CSV file (such as `"en-US"`). The default is invariant culture.
* `maxRows` - The maximal number of rows that should be read from the CSV file.
* `missingValues` - An array of strings that contains values which should be treated
as missing when reading the file. The default value is: "NaN"; "NA"; "#N/A"; ":"; "-"; "TBA"; "TBD".
[category:Input and output]
| |
Static(String, FSharpOptionBoolean, FSharpOptionBoolean, FSharpOptionInt32, FSharpOptionString, FSharpOptionString, FSharpOptionString, FSharpOptionInt32, FSharpOptionString) |
Load data frame from a CSV file. The operation automatically reads column names from the
CSV file (if they are present) and infers the type of values for each column. Columns
of primitive types (`int`, `float`, etc.) are converted to the right type. Columns of other
types (such as dates) are not converted automatically.
## Parameters
* `path` - Specifies a file name or an web location of the resource.
* `hasHeaders` - Specifies whether the input CSV file has header row
* `inferTypes` - Specifies whether the method should attempt to infer types
of columns automatically (set this to `false` if you want to specify schema)
* `inferRows` - If `inferTypes=true`, this parameter specifies the number of
rows to use for type inference. The default value is 100.
* `schema` - A string that specifies CSV schema. See the documentation for
information about the schema format.
* `separators` - A string that specifies one or more (single character) separators
that are used to separate columns in the CSV file. Use for example `";"` to
parse semicolon separated files.
* `culture` - Specifies the name of the culture that is used when parsing
values in the CSV file (such as `"en-US"`). The default is invariant culture.
* `maxRows` - The maximal number of rows that should be read from the CSV file.
* `missingValues` - An array of strings that contains values which should be treated
as missing when reading the file. The default value is: "NaN"; "NA"; "#N/A"; ":"; "-"; "TBA"; "TBD".
[category:Input and output]
| |
StaticT(T) |
Create data frame from a 2D array of values. The first dimension of the array
is used as rows and the second dimension is treated as columns. Rows and columns
of the returned frame are indexed with the element's offset in the array.
## Parameters
- `array` - A two-dimensional array to be converted into a data frame
[category:Frame construction]
| |
StaticT(IEnumerableT) |
Creates a data frame from a sequence of any .NET objects. The method uses reflection
over the specified type parameter `'T` and turns its properties to columns.
[category:Frame construction]
| |
StaticR(IEnumerableR) |
Creates a frame with the specified row keys, but no columns (and no data).
This is useful if you want to build a frame gradually and restrict all the
later added data to a sequence of row keys known in advance.
[category:Frame construction]
| |
StaticR(IEnumerable, String) |
Creates a data frame from a sequence of any .NET objects. The method uses reflection
over the specified type parameter `'T` and turns its properties to columns.
[category:Frame construction]
| |
StaticR(String, String, FSharpOptionBoolean, FSharpOptionBoolean, FSharpOptionInt32, FSharpOptionString, FSharpOptionString, FSharpOptionString, FSharpOptionInt32, FSharpOptionString) |
Load data frame from a CSV file. The operation automatically reads column names from the
CSV file (if they are present) and infers the type of values for each column. Columns
of primitive types (`int`, `float`, etc.) are converted to the right type. Columns of other
types (such as dates) are not converted automatically.
## Parameters
* `path` - Specifies a file name or an web location of the resource.
* `indexCol` - Specifies the column that should be used as an index in the
resulting frame. The type is specified via a type parameter, e.g. use
`Frame.ReadCsv<int>("file.csv", indexCol="Day")`.
* `hasHeaders` - Specifies whether the input CSV file has header row
* `inferTypes` - Specifies whether the method should attempt to infer types
of columns automatically (set this to `false` if you want to specify schema)
* `inferRows` - If `inferTypes=true`, this parameter specifies the number of
rows to use for type inference. The default value is 0, meaninig all rows.
* `schema` - A string that specifies CSV schema. See the documentation for
information about the schema format.
* `separators` - A string that specifies one or more (single character) separators
that are used to separate columns in the CSV file. Use for example `";"` to
parse semicolon separated files.
* `culture` - Specifies the name of the culture that is used when parsing
values in the CSV file (such as `"en-US"`). The default is invariant culture.
* `maxRows` - The maximal number of rows that should be read from the CSV file.
* `missingValues` - An array of strings that contains values which should be treated
as missing when reading the file. The default value is: "NaN"; "NA"; "#N/A"; ":"; "-"; "TBA"; "TBD".
[category:Input and output]
| |
StaticK, R(SeriesK, R) |
Creates a data frame from a series containing any .NET objects. The method uses reflection
over the specified type parameter `'T` and turns its properties to columns.
[category:Frame construction]
| |
StaticC, a, R(IEnumerableTupleC, a) |
Creates a frame from a sequence of column keys and column series pairs.
The column series can contain values of any type, but it has to be the same
for all the series - if you have heterogenously typed series, use `=?>`.
[category:Frame construction]
| |
StaticR, d, C(IEnumerableTupleR, d) |
Creates a frame from a sequence of row keys and row series pairs.
The row series can contain values of any type, but it has to be the same
for all the series - if you have heterogenously typed series, use `=?>`.
[category:Frame construction]
| |
Statice, K, V(IEnumerablee) |
Creates a frame with ordinal Integer index from a sequence of rows.
The column indices of individual rows are unioned, so if a row has fewer
columns, it will be successfully added, but there will be missing values.
[category:Frame construction]
| |
StaticR, C, V(IEnumerableTupleR, C, V) |
Create a data frame from a sequence of tuples containing row key, column key and a value.
[category:Frame construction]
| |
StaticC, b, R(SeriesC, b) |
Creates a frame from a series that maps column keys to a nested series
containing values for each column.
[category:Frame construction]
| |
StaticR, c, C(SeriesR, c) |
Creates a frame from a series that maps row keys to a nested series
containing values for each row.
[category:Frame construction]
| |
ToDataTableTRowKey, TColumnKey |
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"])`.
## Parameters
- `rowKeyNames` - Specifies the names of the row key components (or just a single
row key name if the row index is not hierarchical).
[category:Input and output]
|
Name | Description | |
---|---|---|
EqualsGreatera, b |
Custom operator that can be used when constructing series from observations
or frames from key-row or key-column pairs. The operator simply returns a
tuple, but it provides a more convenient syntax. For example:
series [ "k1" => 1; "k2" => 15 ]
[category:Frame construction]
| |
EqualsQmarkGreatera, b |
Custom operator that can be used when constructing a frame from observations
of series. The operator simply returns a tuple, but it upcasts the series
argument so you don't have to do manual casting. For example:
frame [ "k1" =?> series [0 => "a"]; "k2" =?> series ["x" => "y"] ]
[category:Frame construction]
|