| IOLink C# 1.11.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
IOLink.DataFrameView Class Reference

View to model tabular data. More...

Inheritance diagram for IOLink.DataFrameView:

## Public Member Functions
| DataFrameView (global::System.IntPtr cPtr, bool cMemoryOwn)
virtual DataFrameCapabilitySet | GetCapabilities ()
| Return the view's capabilities.
virtual Vector2u64 | GetShape ()
| Return the shape of the data frame.
virtual string | ColumnName (uint index)
| Get the name of a column from its index.
virtual uint | ColumnIndex (string name)
| Get the index of a column from its name.
virtual DataType | ColumnDataType (uint index)
| Return the data type of the column.
unsafe void | Read (uint column, uint offset, uint count, byte[] dst)
| Read data from a column.
string | Unit (uint columnIndex)
unsafe void | Write (uint column, uint offset, uint count, byte[] src)
| Write data into a column.
void | SetUnit (uint columnIndex, string unit)
virtual void | AddColumn (string name, DataType dtype)
| Add a column to the dataframe.
virtual void | AddRows (uint offset, uint count)
| Insert rows at the specified position.
virtual void | RemoveColumn (uint index)
| Remove a column.
virtual void | RemoveRows (uint offset, uint count)
| Remove a continuous set of rows.
string | ToString ()
| Return a string representation.
void | Reshape (Vector2u64 shape, string[] columnNames, DataType[] columnDataTypes)
| Method to reshape a DataFrame.
unsafe void | Read (uint column, uint offset, uint count, string[] dst)
unsafe void | Write (uint column, uint offset, uint count, string[] src)
Public Member Functions inherited from IOLink.View
| View (global::System.IntPtr cPtr, bool cMemoryOwn)
void | Dispose ()
T | Extension< T > ()
| Get an extension, with automatic upcasting.
virtual Extension | Extension (uint id)
| Get an extension of the view, corresponding to the given identifier.
ViewOriginExtension | ViewOrigin ()
| Shortcut to access to ViewOrigin extension.

## Static Public Member Functions
static global::System.Runtime.InteropServices.HandleRef | getCPtr (DataFrameView obj)
Static Public Member Functions inherited from IOLink.View
static global::System.Runtime.InteropServices.HandleRef | getCPtr (View obj)

## Protected Member Functions
override void | Dispose (bool disposing)

## Properties
DataFrameCapabilitySet | Capabilities`[get]`
| The Capabilities on the `DataFrameView`
Vector2u64 | Shape`[get]`
| The shape on the `DataFrameView`

## Detailed Description

View to model tabular data.

This view is composed of a set of columns, that have a name and a data type. A column's name is unique, and columns in a dataframe can have different data types.

Each column has the same number of elements. The aggregate of all n-th elements of columns are a row of the dataframe.

Examples
  CreateDataFrame.cs.

## Member Function Documentation

## ◆ AddColumn()

virtual void IOLink.DataFrameView.AddColumn | ( | string | name,
|  | DataType | dtype
| ) |  |
| inline virtual

Add a column to the dataframe.

This method requires the RESHAPE capability.

The new column's data will be undefined after addition.

Parameters

  name | The name of the new column.
  dtype | The type of data stored in the column.

Exceptions

  NotImplemented | When the view does not support reshaping.
  Error | if there is already a column with the same name.
  Error | if the implementation does not support the data type.

Examples
  CreateDataFrame.cs.

## ◆ AddRows()

virtual void IOLink.DataFrameView.AddRows | ( | uint | offset,
|  | uint | count
| ) |  |
| inline virtual

Insert rows at the specified position.

This method requires the RESHAPE capability.

New rows content will be undefined after insertion.

Parameters

  offset | New rows will be inserted before this row. If the offset is the number of rows in the dataframe, rows will be inserted at the end.
  count | The number of rows to insert.

Exceptions

  NotImplemented | When the view does not support reshaping.
  Error | When offset is out of bounds.
  Error | When it is impossible to add these rows.

## ◆ ColumnDataType()

virtual DataType IOLink.DataFrameView.ColumnDataType | ( | uint | index | ) |
| inline virtual

Return the data type of the column.

Parameters

  index | The index of the column.

Exceptions

  Error | When index is out of range.

## ◆ ColumnIndex()

virtual uint IOLink.DataFrameView.ColumnIndex | ( | string | name | ) |
| inline virtual

Get the index of a column from its name.

Parameters

  name | The name of the column.

Exceptions

  Error | If there is no column with that name.

## ◆ ColumnName()

virtual string IOLink.DataFrameView.ColumnName | ( | uint | index | ) |
| inline virtual

Get the name of a column from its index.

Column indices go from 0 to shape[0] - 1.

Parameters

  index | The index of the column.

Exceptions

  Error | If index is out of range.

## ◆ Dispose()

override void IOLink.DataFrameView.Dispose | ( | bool | disposing | ) |
| inline protected virtual

Reimplemented from IOLink.View.

## ◆ GetShape()

virtual Vector2u64 IOLink.DataFrameView.GetShape | ( |  | ) |
| inline virtual

Return the shape of the data frame.

First element being the number of columns, and the second, the number of rows.

## ◆ Read()

unsafe void IOLink.DataFrameView.Read | ( | uint | column,
|  | uint | offset,
|  | uint | count,
|  | byte[] | dst
| ) |  |
| inline

Read data from a column.

This method requires the READ capability.

When reading numeric data, the dst buffer will be filled with continuous values. In the case of strings, it will be a continuous array of string objects.

The destination buffer must be allocated by the user. If its size is under the byte count needed to store the request number of elements, a segmentation fault will rise, as there is no boundaries check.

Parameters

  column | The index of the column to read from.
  offset | The index of the first element to read.
  count | The number of elements to read.
  dst | A buffer where the read data will be written.

Exceptions

  NotImplemented | When the view does not support reading.
  Error | When dst is null.
  Error | When the column index is invalid.
  Error | When offset is out of bounds.
  Error | If it is impossible to read the number of elements required.

## ◆ RemoveColumn()

virtual void IOLink.DataFrameView.RemoveColumn | ( | uint | index | ) |
| inline virtual

Remove a column.

This method requires the RESHAPE capability.

Parameters

  index | The index of the column to remove.

Exceptions

  NotImplemented | When the view does not support reshaping.
  Error | If the index is out of bounds.
  Error | When it is impossible to remove that column.

## ◆ RemoveRows()

virtual void IOLink.DataFrameView.RemoveRows | ( | uint | offset,
|  | uint | count
| ) |  |
| inline virtual

Remove a continuous set of rows.

This method requires the RESHAPE capability.

Parameters

  offset | The index of the first column to remove.
  count | Row count to delete.

Exceptions

  NotImplemented | When the view does not support reshaping.
  Error | When offset is out of bounds.
  Error | When it is impossible to remove these rows.

## ◆ Reshape()

void IOLink.DataFrameView.Reshape | ( | Vector2u64 | shape,
|  | string[] | columnNames,
|  | DataType[] | columnDataTypes
| ) |  |
| inline

Method to reshape a DataFrame.

This method requires the RESHAPE capability.

All the dataframe's data is invalidated after this operation.

Parameters

  shape | shape of the allocated dataframe (column count, row count)
  columnNames | Array which contains the name for each column
  columnDataTypes | Array which contains the data type of each column

No check is done on inputs. Pass arguments very carefully. columnNames and columnDataTypes shall have the same element count, and their size must be equal to shape[0].

column count and row count cannot be 0.

## ◆ Write()

unsafe void IOLink.DataFrameView.Write | ( | uint | column,
|  | uint | offset,
|  | uint | count,
|  | byte[] | src
| ) |  |
| inline

Write data into a column.

This method requires the WRITE capability.

When writing numeric data, the src buffer must be filled with continuous values. In the case of strings, the source must use a continuous array of string objects.

The source buffer must be allocated by the user. If its size is under the byte count needed to store the request number of elements, a segmentation fault will rise, as there is no boundaries check.

Parameters

  column | The index of the column to write into.
  offset | The index of the first element to write.
  count | The number of element to write.
  src | A buffer whose content will be written in the column.

Exceptions

  NotImplemented | When the view does not support writing.
  Error | When src is null.
  Error | When the column index is invalid.
  Error | When offset is out of bounds.
  Error | If it is impossible to write the number of elements required.

The documentation for this class was generated from the following file:

- Release/net/generated/DataFrameView.cs