◆ allocate() [1/2]
| static std::shared_ptr< DataFrameView > iolink::DataFrameViewFactory::allocate |
( |
| ) |
|
|
static |
This factory aims to create an empty DataFrame view.
Columns and rows can be added later.
◆ allocate() [2/2]
| static std::shared_ptr< DataFrameView > iolink::DataFrameViewFactory::allocate |
( |
const Vector2u64 & |
shape, |
|
|
const std::string * |
columnNames, |
|
|
const DataType * |
columnDataTypes |
|
) |
| |
|
static |
This factory is aimed at creating a DataFrame view.
- 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 |
- Returns
- an in-memory DataFrameView
Vectorial DataTypes are not supported so far.
- Warning
- 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. To create an empty dataframe, use the parameterless allocate method.
- Exceptions
-
◆ concatenateRows()
Concatenate the rows of two dataframes.
- Parameters
-
| df1 | first dataframe |
| df2 | second dataframe whose rows are appended after rows of the first dataframe |
- Warning
- Data of both dataframes is duplicated in the resulting dataframe.
Both dataframe must have the same column count, names and dataTypes. Units are not checked. Only units of the first dataframe are kept.
The resulting dataframe will have the same column count, column names and dataTypes as the input dataframes. Rows of the second dataframe are appended to the rows of the first dataframe.
- Exceptions
-
| Error | if the dataframes have different column count, names or dataTypes. |
- Returns
- a new dataframe which is the concatenation of df1 and df2
◆ fromTensor()
| static std::shared_ptr< DataFrameView > iolink::DataFrameViewFactory::fromTensor |
( |
std::shared_ptr< TensorView > |
tensor, |
|
|
const std::string * |
columnNames, |
|
|
size_t |
count |
|
) |
| |
|
static |
Create a DataFrameView from a TensorView.
The first dimension of the tensor will be used as the columns axis, and the second dimension as the rows' one.
- Parameters
-
| tensor | The source tensor to convert into a DataFrameView. |
| columnNames | A string containing the names of the columns, separated by commas. |
| count | The number of element in the columnNames argument. |
- Returns
- A shared pointer to the created DataFrameView.
- Exceptions
-
| Invalid | Argument If the source tensor is null |
| Invalid | Argument If the tensor is not 2-dimensional |
| Invalid | Argument If the number of column names does not match the first dimension of the tensor |
The documentation for this class was generated from the following file: