Frame Methods |
The Frame type exposes the following members.
Name | Description | |
---|---|---|
CreateEmptyR, C | ||
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
FromArray2DT |
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
| |
FromColumnsTColKey, TRowKey(SeriesTColKey, ObjectSeriesTRowKey) | ||
FromColumnsColKey, RowKey(IEnumerableKeyValuePairColKey, ObjectSeriesRowKey) | ||
FromColumnsColKey, V(IEnumerableSeriesColKey, V) | ||
FromColumnsTColKey, TRowKey, V(SeriesTColKey, SeriesTRowKey, V) | ||
FromColumnsColKey, RowKey, V(IEnumerableKeyValuePairColKey, SeriesRowKey, V) | ||
FromRecordsT(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. The
rows of the resulting frame are automatically indexed by `int`.
## Example
The method can be nicely used to create a data frame using C# anonymous types
(the result is a data frame with columns "A" and "B" containing two rows).
[lang=csharp]
var df = Frame.FromRecords(new[] {
new { A = 1, B = "Test" },
new { A = 2, B = "Another"}
});
| |
FromRecordsK, R(SeriesK, R) |
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.
| |
FromRowKeysK | ||
FromRowsTColKey, TRowKey(SeriesTColKey, ObjectSeriesTRowKey) | ||
FromRowsRowKey, ColKey(IEnumerableKeyValuePairRowKey, ObjectSeriesColKey) | ||
FromRowsColKey, V(IEnumerableSeriesColKey, V) | ||
FromRowsTColKey, TRowKey, V(SeriesTColKey, SeriesTRowKey, V) | ||
FromRowsRowKey, ColKey, V(IEnumerableKeyValuePairRowKey, SeriesColKey, V) | ||
FromValuesa, b, c(IEnumerableTuplea, b, c) |
Create a data frame from a sequence of tuples containing row key, column key and a value
| |
FromValuesT, C, R, V(IEnumerableT, FuncT, C, FuncT, R, FuncT, V) |
Create a data frame from a sequence of objects and functions that return
row key, column key and value for each object in the input sequence.
## Parameters
- `values` - Input sequence of objects
- `colSel` - A function that returns the column key of an object
- `rowSel` - A function that returns the row key of an object
- `valSel` - A function that returns the value of an object
| |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ReadCsv(Stream, NullableBoolean, NullableBoolean, NullableInt32, String, String, String, NullableInt32, String) |
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
(when not set, the default value is `true`)
* `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]
| |
ReadCsv(String, NullableBoolean, NullableBoolean, NullableInt32, String, String, String, NullableInt32, String) |
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
* `location` - Specifies a file name or an web location of the resource.
* `hasHeaders` - Specifies whether the input CSV file has header row
(when not set, the default value is `true`)
* `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` - Specifies the maximum number of rows that will be read from the CSV file
[category:Input and output]
| |
ReadReader |
Read data from `IDataReader`. The method reads all rows from the data reader
and for each row, gets all the columns. When a value is `DBNull`, it is treated
as missing. The types of created vectors are determined by the field types reported
by the data reader.
[category:Input and output]
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |