IOLink C# 1.11.0
Loading...
Searching...
No Matches
IOLink.DataFrameView Class Reference

View to model tabular data. More...

Inheritance diagram for IOLink.DataFrameView:
IOLink.View

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)
 

Static Public Member Functions

static global::System.Runtime.InteropServices.HandleRef getCPtr (DataFrameView 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 
)
inlinevirtual

Add a column to the dataframe.

This method requires the RESHAPE capability.

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

Parameters
nameThe name of the new column.
dtypeThe type of data stored in the column.
Exceptions
NotImplementedWhen the view does not support reshaping.
Errorif there is already a column with the same name.
Errorif the implementation does not support the data type.
Examples
CreateDataFrame.cs.

◆ AddRows()

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

Insert rows at the specified position.

This method requires the RESHAPE capability.

New rows content will be undefined after insertion.

Parameters
offsetNew 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.
countThe number of rows to insert.
Exceptions
NotImplementedWhen the view does not support reshaping.
ErrorWhen offset is out of bounds.
ErrorWhen it is impossible to add these rows.

◆ ColumnDataType()

virtual DataType IOLink.DataFrameView.ColumnDataType ( uint  index)
inlinevirtual

Return the data type of the column.

Parameters
indexThe index of the column.
Exceptions
ErrorWhen index is out of range.

◆ ColumnIndex()

virtual uint IOLink.DataFrameView.ColumnIndex ( string  name)
inlinevirtual

Get the index of a column from its name.

Parameters
nameThe name of the column.
Exceptions
ErrorIf there is no column with that name.

◆ ColumnName()

virtual string IOLink.DataFrameView.ColumnName ( uint  index)
inlinevirtual

Get the name of a column from its index.

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

Parameters
indexThe index of the column.
Exceptions
ErrorIf index is out of range.

◆ Dispose()

override void IOLink.DataFrameView.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from IOLink.View.

◆ GetShape()

virtual Vector2u64 IOLink.DataFrameView.GetShape ( )
inlinevirtual

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
columnThe index of the column to read from.
offsetThe index of the first element to read.
countThe number of elements to read.
dstA buffer where the read data will be written.
Exceptions
NotImplementedWhen the view does not support reading.
ErrorWhen dst is null.
ErrorWhen the column index is invalid.
ErrorWhen offset is out of bounds.
ErrorIf it is impossible to read the number of elements required.

◆ RemoveColumn()

virtual void IOLink.DataFrameView.RemoveColumn ( uint  index)
inlinevirtual

Remove a column.

This method requires the RESHAPE capability.

Parameters
indexThe index of the column to remove.
Exceptions
NotImplementedWhen the view does not support reshaping.
ErrorIf the index is out of bounds.
ErrorWhen it is impossible to remove that column.

◆ RemoveRows()

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

Remove a continuous set of rows.

This method requires the RESHAPE capability.

Parameters
offsetThe index of the first column to remove.
countRow count to delete.
Exceptions
NotImplementedWhen the view does not support reshaping.
ErrorWhen offset is out of bounds.
ErrorWhen 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
shapeshape of the allocated dataframe (column count, row count)
columnNamesArray which contains the name for each column
columnDataTypesArray 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
columnThe index of the column to write into.
offsetThe index of the first element to write.
countThe number of element to write.
srcA buffer whose content will be written in the column.
Exceptions
NotImplementedWhen the view does not support writing.
ErrorWhen src is null.
ErrorWhen the column index is invalid.
ErrorWhen offset is out of bounds.
ErrorIf it is impossible to write the number of elements required.

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