Angara.Table


Table

Namespace: Angara.Data

Represents a table wich is an immutable list of named columns. The type is thread safe.

Instance members

Instance memberDescription
Count
Signature: int

Gets a count of the total number of columns in the table.

CompiledName: get_Count

[index]
Signature: index:int -> Column

Gets a column by its index.

CompiledName: get_Item

[name]
Signature: name:string -> Column

Gets a column by its name. If there are several columns with same name, returns the fist column having the name.

CompiledName: get_Item

RowsCount
Signature: int

Gets a count of the total number rows in the table.

CompiledName: get_RowsCount

ToRows()
Signature: unit -> seq<'r>
Modifiers: abstract
Type parameters: 'r

Builds and returns rows of the table represented as a sequence of instances of the type 'r', so that one instance of'r` corresponds to one row of the table with the order respected.

Columns are mapped to public properties of 'r. If there is a column in the table such that 'r' has no public property with same name, the column is ignored. Next, if 'r' has a property such that there is no column with same name, the function fails with an exception.

The method uses reflection to build instances of 'r from the table columns: - If 'r is F# record, then for each property of the type there must be a corresponding column of identical type. - Otherwise, then 'r has default constructor and for each public writable property there must be a column of same name and type as the property.

TryItem(index)
Signature: index:int -> Column option

Tries to get a column by its index.

CompiledName: get_TryItem

TryItem(name)
Signature: name:string -> Column option

Tries to get a column by its name. If there are several columns with same name, returns the fist column having the name.

CompiledName: get_TryItem

Static members

Static memberDescription
Add(column table)
Signature: column:Column -> table:Table -> Table

Creates a new table that has all columns of the original table appended with the given column. Duplicate names are allowed.

Append(table1 table2)
Signature: table1:Table -> table2:Table -> Table

Builds a new table that contains the columns of both given tables in order. Duplicate column names are allowed.

AppendMatrix(table1 table2)
Signature: table1:MatrixTable<'v> -> table2:MatrixTable<'v> -> MatrixTable<'v>
Type parameters: 'v

Builds a new matrix table by concatenting columns of two given matrix tables. Duplicate column names are allowed.

AppendTransform(...)
Signature: columnNames:seq<string> -> (transform:(ImmutableArray<'a> -> 'b)) -> table:Table -> Table
Type parameters: 'a, 'b

Builds a new table that contains columns of the given table appended with columns of a table produced by the given function applied to the values of the given table columns. The generic transform function is only partially defined but its ultimate result must be of type Table.

DefaultColumnName(columnIndex)
Signature: columnIndex:int -> string

Returns a default column from a column index. The produced names are similar to Excel column names; e.g. "A", "B", ..., "Z", "AA", "AB", ...

Empty
Signature: Table

Creates a new, empty table

CompiledName: get_Empty

Filter(columnNames predicate table)
Signature: columnNames:seq<string> -> (predicate:('a -> 'b)) -> table:Table -> Table
Type parameters: 'a, 'b

The function Table.Filter returns a new table containing only the rows of the table for which the given predicate returns true. The predicate gets values of the given columns only. The generic predicate function is only partially defined.

Filteri(columnNames predicate table)
Signature: columnNames:seq<string> -> (predicate:(int -> 'a)) -> table:Table -> Table
Type parameters: 'a

The function Table.Filter returns a new table containing only the rows of the table for which the given predicate returns true. The predicate gets values of the given columns only. An integer index passed to the predicate is the index of row being filtered. The generic predicate function is only partially defined.

Load(reader, settings)
Signature: (reader:TextReader * settings:ReadSettings) -> Table

Loads a table from a delimited text stream using given reader.

Load(reader)
Signature: reader:TextReader -> Table

Loads a table from a delimited text stream using given reader.

Load(path, settings)
Signature: (path:string * settings:ReadSettings) -> Table

Loads a table from a delimited text file.

Load(path)
Signature: path:string -> Table

Loads a table from a delimited text file.

Map(columnNames map table)
Signature: columnNames:seq<string> -> (map:('a -> 'b)) -> table:Table -> seq<'c>
Type parameters: 'a, 'b, 'c

Builds a new sequence whose elements are the results of applying the given function 'map' to each of the rows of the given table columns. The generic map function is only partially defined.

Mapi(columnNames map table)
Signature: columnNames:seq<string> -> (map:(int -> 'a)) -> table:Table -> seq<'c>
Type parameters: 'a, 'c

Builds a new sequence whose elements are the results of applying the given function 'map' to each of the rows of the given table columns. The integer index passed to the function indicates the index of row being transformed. The generic map function is only partially defined.

MapiToColumn(...)
Signature: newColumnName:string -> columnNames:seq<string> -> (map:(int -> 'a)) -> table:Table -> Table
Type parameters: 'a

Builds a new table that contains all columns of the given table and a new column or a replacement of an original table column; elements of the column are the results of applying the given function to each of the rows of the given table columns. The integer index passed to the function indicates the index of row being transformed. The generic map function is only partially defined. Ultimate result type of the map function must be either float, int, string, bool or DateTime.

MapToColumn(...)
Signature: newColumnName:string -> columnNames:seq<string> -> (map:('a -> 'b)) -> table:Table -> Table
Type parameters: 'a, 'b

Builds a new table that contains all columns of the given table and a new column or a replacement of an original table column; elements of the column are the results of applying the given function to each of the rows of the given table columns. The generic map function is only partially defined. Ultimate result type of the map function must be either float, int, string, bool or DateTime.

OfColumns(columns)
Signature: columns:seq<Column> -> Table

Builds a table from a finite sequence of columns. All given columns must be of same height. Duplicate column names are allowed. Order of columns in the table is same as in the input sequence.

OfMatrix(matrixRows, columnNames)
Signature: (matrixRows:seq<ImmutableArray<'v>> * columnNames:seq<string> option) -> MatrixTable<'v>
Type parameters: 'v
OfMatrix(matrixRows, columnNames)
Signature: (matrixRows:seq<'v []> * columnNames:seq<string> option) -> MatrixTable<'v>
Type parameters: 'v
OfMatrix(matrixRows, columnNames)
Signature: (matrixRows:seq<seq<'v>> * columnNames:seq<string> option) -> MatrixTable<'v>
Type parameters: 'v

Builds a matrix table such that all columns have same type. Matrix table exposes its content as a two-dimensional array as well as a collection of columns. If column names are missed, the default names are given; see Table.DefaultColumnName function.

OfRows(arg1)
Signature: ImmutableArray<'r> -> Table<'r>
Type parameters: 'r

Builds a table such that each public property of a given type 'r becomes the table column with the name and type identical to the property; each table row corresponds to an element of the input sequence with the order respected. If the type 'r is an F# record, the order of columns is identical to the record properties order. If there is a public property having a type that is not valid for a table column, the function fails with an exception.

OfRows(arg1)
Signature: seq<'r> -> Table<'r>
Type parameters: 'r

Builds a table such that each public property of a given type 'r becomes the table column with the name and type identical to the property; each table row corresponds to an element of the input sequence with the order respected. If the type 'r is an F# record, the order of columns is identical to the record properties order. If there is a public property having a type that is not valid for a table column, the function fails with an exception.

Remove(columnNames table)
Signature: columnNames:seq<string> -> table:Table -> Table

Creates a new table that has all columns of the original table excluding the columns having name contained in the given column names.

Save(table, writer, settings)
Signature: (table:Table * writer:TextWriter * settings:WriteSettings) -> unit

Saves the table to a delimited text stream using given writer.

Save(table, writer)
Signature: (table:Table * writer:TextWriter) -> unit

Saves the table to a delimited text stream using given writer.

Save(table, path, settings)
Signature: (table:Table * path:string * settings:WriteSettings) -> unit

Saves the table to a delimited text file, overwriting an existing file, if it exists.

Save(table, path)
Signature: (table:Table * path:string) -> unit

Saves the table to a delimited text file, overwriting an existing file, if it exists.

Transform(columnNames transform table)
Signature: columnNames:seq<string> -> (transform:(ImmutableArray<'a> -> 'b)) -> table:Table -> 'c
Type parameters: 'a, 'b, 'c

Applies the given function to the values of the given table columns and returns the function result. Each column is represented as an immutable array. The generic transform function is only partially defined.

Fork me on GitHub