Divooka.DataAnalytics

Divooka.DataAnalytics.DataGridOperations.Statistics

Provides statistics related functions.

Divooka.DataAnalytics.DataGridOperations.Statistics.MatrixMultiply()

Dynamic connector sequence, With option to transpose.

Remarks

Simple matrix helper; Not intended for heavy duty linear algebra work - use Matrix package instead.

Parameters

NameDescriptionDefault
dataGrids Array of DataGrid objects representing matrices to multiply.
shouldTransposes Array of booleans indicating whether to transpose each corresponding DataGrid before multiplication.

Returns

The resulting DataGrid after performing matrix multiplication.

Divooka.DataAnalytics.DataGridOperations.Statistics.MatrixMultiply()

Performs matrix multiplication between two DataGrids using only numerical columns.

Remarks

Simple matrix helper; Not intended for heavy duty linear algebra work - use Matrix package instead.

Parameters

NameDescriptionDefault
dataGrid The left-hand side DataGrid representing the first matrix.
other The right-hand side DataGrid representing the second matrix.

Returns

The resulting DataGrid after multiplying the two matrices.

Divooka.DataAnalytics.DataGridOperations.Statistics.Mean()

Calculates the arithmetic mean of the numerical data in the DataColumn.

Parameters

NameDescriptionDefault
dataColumn The DataColumn containing numerical data.

Returns

The mean value of the data.

Divooka.DataAnalytics.DataGridOperations.Statistics.Variance()

Calculates the variance of the numerical data in the DataColumn.

Parameters

NameDescriptionDefault
dataColumn The DataColumn containing numerical data.
population If true, divides by (n-1) for population variance; otherwise divides by n for sample variance.

Returns

The variance of the data.

Divooka.DataAnalytics.DataGridOperations.Statistics.StandardDeviation()

Calculates the standard deviation of the numerical data in the DataColumn.

Parameters

NameDescriptionDefault
dataColumn The DataColumn containing numerical data.
population If true, uses population variance divisor (n-1); otherwise uses sample variance divisor (n).

Returns

The standard deviation of the data.

Divooka.DataAnalytics.DataGridOperations.Statistics.Min()

Finds the minimum value in the numerical data of the DataColumn.

Parameters

NameDescriptionDefault
dataColumn The DataColumn containing numerical data.

Returns

The minimum value.

Divooka.DataAnalytics.DataGridOperations.Statistics.Max()

Finds the maximum value in the numerical data of the DataColumn.

Parameters

NameDescriptionDefault
dataColumn The DataColumn containing numerical data.

Returns

The maximum value.

Divooka.DataAnalytics.DataGridOperations.Statistics.Sum()

Calculates the sum of the numerical data in the DataColumn.

Parameters

NameDescriptionDefault
dataColumn The DataColumn containing numerical data.

Returns

The sum of the data.

Divooka.DataAnalytics.DataGridOperations.Statistics.Correlation()

Calculates the correlation coefficient between two numerical DataColumns.

Parameters

NameDescriptionDefault
dataColumn The first DataColumn containing numerical data.
other The second DataColumn containing numerical data.

Returns

The correlation coefficient.

Divooka.DataAnalytics.DataGridOperations.Statistics.Covariance()

Calculates the covariance between two numerical DataColumns.

Parameters

NameDescriptionDefault
dataColumn The first DataColumn containing numerical data.
other The second DataColumn containing numerical data.

Returns

The covariance value.

Divooka.DataAnalytics.DataGridOperations.Statistics.Distinct()

Retrieves distinct values from a specified column in the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid to operate on.
columnName The name of the column from which to extract distinct values.
values Outputs an array of distinct string values found in the specified column.

Divooka.DataAnalytics.DataGridOperations.Statistics.RobustMean()

Calculates a robust mean from either an array of doubles or a specified column in a DataGrid.

Remarks

I don't remember what's the intention of this

Parameters

NameDescriptionDefault
list An array of doubles. Use this when computing the mean directly from numerical values.
dataGrid A DataGrid containing data if not using the list parameter.
columnName The name of the column in the DataGrid to compute the mean.
columnSelection An optional column index for selecting the column in the DataGrid. GUI can provide more specific dynamic behavior for this parameter based on Table Input, e.g. hide it when dataGrid is not hooked, and provide enumeration if input table contains headers.
resultList Outputs the input list if used; otherwise, it is null.
resultDataGrid Outputs the input DataGrid if used; otherwise, it is null.
resultValue Outputs the computed mean value.

Divooka.DataAnalytics.DataGridOperations.Statistics.Range()

Calculates the minimum, maximum, and range of a numerical column in the DataGrid and returns a formatted message. Also displays those numbers in three lines in the node message content.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the column.
columnName The name of the column to analyze.
min Outputs the minimum value in the column.
max Outputs the maximum value in the column.
range Outputs the difference between the maximum and minimum values.
message Used for node message. Outputs a formatted string displaying the min, max, and range values.

Divooka.DataAnalytics.DataGridOperations.Statistics.Mean()

Calculates the mean value from a specified numerical column in the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the column.
columnName The name of the column to compute the mean.

Returns

The mean value of the column.

Divooka.DataAnalytics.DataGridOperations.Statistics.Variance()

Calculates the variance from a specified numerical column in the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the column.
columnName The name of the column to compute the variance.

Returns

The variance value of the column.

Divooka.DataAnalytics.DataGridOperations.Statistics.StandardDeviation()

Calculates the standard deviation from a specified numerical column in the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the column.
columnName The name of the column to compute the standard deviation.

Returns

The standard deviation value of the column.

Divooka.DataAnalytics.DataGridOperations.Statistics.Min()

Retrieves the minimum value from a specified numerical column in the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the column.
columnName The name of the column to analyze.

Returns

The minimum value of the column.

Divooka.DataAnalytics.DataGridOperations.Statistics.Max()

Retrieves the maximum value from a specified numerical column in the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the column.
columnName The name of the column to analyze.

Returns

The maximum value of the column.

Divooka.DataAnalytics.DataGridOperations.Statistics.Sum()

Calculates the sum of the numerical values in a specified column of the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the column.
columnName The name of the column whose values are to be summed.

Returns

The sum of the column values.

Divooka.DataAnalytics.DataGridOperations.Statistics.Correlation()

Calculates the correlation coefficient between two DataGrids based on specified numerical columns.

Parameters

NameDescriptionDefault
dataGrid1 The first DataGrid containing the column.
dataGrid2 The second DataGrid containing the column.
columnName1 The name of the column in the first DataGrid.
columnName2 The name of the column in the second DataGrid.

Returns

The correlation coefficient between the two columns.

Divooka.DataAnalytics.DataGridOperations.Statistics.Covariance()

Calculates the covariance between two DataGrids based on specified numerical columns.

Parameters

NameDescriptionDefault
dataGrid1 The first DataGrid containing the column.
dataGrid2 The second DataGrid containing the column.
columnName1 The name of the column in the first DataGrid.
columnName2 The name of the column in the second DataGrid.

Returns

The covariance between the two columns.

Divooka.DataAnalytics.DataGridOperations.Statistics.CovarianceMatrix()

Calculates the covariance matrix for the numerical columns of the DataGrid.

Remarks

TODO: Redundant, remove this function alltogether - or update DataGrid interface to implement covariance matrix here instead

Parameters

NameDescriptionDefault
dataGrid The DataGrid to analyze.

Returns

A DataGrid representing the covariance matrix.

Divooka.DataAnalytics.DataGridOperations.Statistics.PercentReturn()

Calculates the percentage return for each numerical column in the DataGrid.

Parameters

NameDescriptionDefault
dataGrid The DataGrid containing the financial data.
LatestAtTop Determines whether the latest data is at the top of the column. If true, returns computed values starting from the top.

Returns

A new DataGrid containing the percentage return values for each numerical column.

Divooka.DataAnalytics.DataGridOperations.Preprocessing.Clean()

Cleans incoming data grid, reports bad rows, keeps good ones.

Divooka.DataAnalytics.DivookaDataColumn

Remarks

This feels like an implementation detail and since DataGrid exposes most column-wise operations directly, we do not want to expose this class to frontend by default. We prefer to put all const/pure/readonly functions (aka. no state chnage) and all transformation functions (aka. completely different state) to external classes, and keep only state relevant functions here.

Divooka.DataAnalytics.DivookaDataColumn.InvalidValueTypeHandlingPolicy.ThrowException

Throws exception

Divooka.DataAnalytics.DivookaDataColumn.InvalidValueTypeHandlingPolicy.DBNullify

Set the value to DBNull

Divooka.DataAnalytics.DivookaDataColumn.InvalidValueTypeHandlingPolicy.Keep

Keep new value without modifying column type

Divooka.DataAnalytics.DivookaDataColumn.InvalidValueTypeHandlingPolicy.InitializeDefault

Initialize default value using column type

Divooka.DataAnalytics.DivookaDataColumn.InvalidValueTypeHandlingPolicy.ChangeColumnToMixedType

Change column type to object

Divooka.DataAnalytics.DivookaDataColumn.InvalidValueTypeHandlingPolicy.ChangeColumnToStringType

Change and convert existing values and column type to string

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.ThrowException

Throws exception

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.DBNullify

Set the value to DBNull

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.Keep

Keep new value without modifying column type

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.InitializeDefault

Initialize default value using column type

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.ChangeColumnToMixedType

Change column type to object

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.ChangeColumnToStringType

Change and convert existing values and column type to string

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.Drop

Remarks

Must be handled indirectly by caller.

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.ForwardFill

Use available value from prev valid cell.

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.BackwardFill

Use available value from next valid cell.

Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.LinearlyInterpolate

For numerical values, linearly interpolate between available endpoints.

Remarks

Might be better to implement as pre-processing data grid operation targeting specific column types.

Divooka.DataAnalytics.DivookaDataColumn.Header

Divooka.DataAnalytics.DivookaDataColumn.ColumnData

Divooka.DataAnalytics.DivookaDataColumn.ColumnType

Divooka.DataAnalytics.DivookaDataColumn.Length

Divooka.DataAnalytics.DivookaDataColumn.NaNCount

Divooka.DataAnalytics.DivookaDataColumn.TypeName

Divooka.DataAnalytics.DivookaDataColumn.Type

Divooka.DataAnalytics.DivookaDataColumn.TypeIsNumber

Divooka.DataAnalytics.DivookaDataColumn.TypeIsDateOrTime

Divooka.DataAnalytics.DivookaDataColumn.Distinct()

Get distinct value as string; If column contain null, optionally ignores null. Represents null as "<NULL>".

Returns

Returns a list of string values

Divooka.DataAnalytics.DivookaDataGrid

A programmer/Pure/C#/Parcel friendly API for tabular data representation, with very versatile APIs. Object oriented: assumes rows contain objects and columns are object attributes. Headers are thus names of those attributes. Certain functions have such assumptions built-in for optimal results. Notice column names can be anything and it may affect down-stream display and processing e.g. when fed into SQL (duplicate column names can cause issues) or displayed directly in WPF (column names containing / will not bind properly).

Remarks

In general, unless absolutely necessary, for small return results, we should favour arrays instead of IEnumerables because that avoids one extra function call (e.g. ToArray) at the caller. TODO: Consolidate with Parcel.Math.Types.Vector type TODO: Make this type completely immutable.

Divooka.DataAnalytics.DivookaDataGrid.ColumnInfo.NewKey

Gets or sets the processed key name for the column, used for display purposes.

Divooka.DataAnalytics.DivookaDataGrid.ColumnInfo.OriginalHeader

Gets or sets the original header name of the column from the dataset.

Divooka.DataAnalytics.DivookaDataGrid.ColumnInfo.ColumnIndex

Gets or sets the zero-based index of the column in the dataset.

Divooka.DataAnalytics.DivookaDataGrid.ColumnInfo.TypeName

Gets or sets the data type name of the column.

Divooka.DataAnalytics.DivookaDataGrid.Preformatting()

Automatically parse a string value to plausible strongly typed objects

Parameters

NameDescriptionDefault
inputValue

Returns

Divooka.DataAnalytics.DivookaDataGrid.#ctor

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class.

Remarks

This default constructor creates an empty DataGrid with its default settings.

Divooka.DataAnalytics.DivookaDataGrid.#ctor()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class with the specified table name and data from an System.Dynamic.ExpandoObject.

Remarks

This constructor extracts keys from the provided System.Dynamic.ExpandoObject, creates a new Divooka.DataAnalytics.DivookaDataColumn for each key, adds the corresponding value to the column, and then includes the column in the DataGrid.

Parameters

NameDescriptionDefault
name The name of the table to be assigned to the DataGrid.
expando An System.Dynamic.ExpandoObject containing key/value pairs where each key represents a column name and each value is the initial data for that column.

Divooka.DataAnalytics.DivookaDataGrid.#ctor()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class with the specified table name and an array of data columns.

Remarks

The provided columns are assigned to the DataGrid’s internal column collection.

Parameters

NameDescriptionDefault
name The name of the table to be assigned to the DataGrid.
columns A variable number of Divooka.DataAnalytics.DivookaDataColumn objects that will be included in the DataGrid.

Divooka.DataAnalytics.DivookaDataGrid.#ctor()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class using the first table from a System.Data.DataSet.

Remarks

This constructor retrieves the first System.Data.DataTable from the provided System.Data.DataSet, assigns its table name to the DataGrid, and loads the data from the table using the InitializeFromDataTable method.

Parameters

NameDescriptionDefault
dataset The System.Data.DataSet that contains the table data.
forceFirstLineAsHeader A boolean value indicating whether the first line of the table should be treated as the header. The default is false.

Divooka.DataAnalytics.DivookaDataGrid.#ctor()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class using a System.Data.DataTable.

Remarks

This constructor loads the grid data from the provided System.Data.DataTable by calling the InitializeFromDataTable method with header processing disabled.

Parameters

NameDescriptionDefault
dataTable The System.Data.DataTable from which to load the grid data.

Divooka.DataAnalytics.DivookaDataGrid.GenerateRandomNumbers()

Remarks

TODO: Do multiple columns.

Parameters

NameDescriptionDefault
count
min
max

Returns

Divooka.DataAnalytics.DivookaDataGrid.GenerateRandomIntegers()

Remarks

TODO: Do multiple columns.

Parameters

NameDescriptionDefault
count
min
max

Returns

Divooka.DataAnalytics.DivookaDataGrid.CreateFromCSVFile()

Read CSV file as DataGrid.

Parameters

NameDescriptionDefault
filePath
containsHeader
invalidValuePolicy

Returns

Divooka.DataAnalytics.DivookaDataGrid.CreateFromCSVText()

Initialize DataGrid from csv text

Divooka.DataAnalytics.DivookaDataGrid.CreateFromIEnumerable()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class from an array of values. Each element of the array becomes one item/row of the table.

Remarks

This constructor creates a single Divooka.DataAnalytics.DivookaDataColumn named "Values" and adds each element from the provided collection. When the first value is added, the column automatically performs type detection and sets the appropriate data type. Notice depending on the actual element type, the resulting single-column data grid may not be directly readable; Consider using other more powerful creation methods or explicitly initialize from data columns instead.

Parameters

NameDescriptionDefault
name The name of the table to be assigned to the DataGrid.
values An System.Collections.IEnumerable collection of values (such as System.Double, System.Int32, or System.String) that will be used to create a single data column.

Divooka.DataAnalytics.DivookaDataGrid.CreateFromObjectProperties()

Create a data grid from object properties for complex types; For simple/value types this is just a single value column.

Remarks

For value types this is equivalanet to Divooka.DataAnalytics.DivookaDataGrid.CreateFromIEnumerable()

Parameters

NameDescriptionDefault
name
items
stringfyComplexValues For complex properties, we just show the string representation of its type instead of storing actual object.

Returns

Divooka.DataAnalytics.DivookaDataGrid.CreateFromListOfRowObjects()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class with the specified table name and rows.

Remarks

When firstRowHeaders is true, the first row in rows is used to initialize column headers, and the remaining rows are treated as data.

Parameters

NameDescriptionDefault
name The name of the data grid table.
rows A list of rows where each row is a list of objects. If firstRowHeaders is true, the first row is interpreted as column headers.
firstRowHeaders Indicates whether the first row of rows contains column headers. The default value is true.
invalidValuePolicy The policy for handling invalid value types when adding data to columns.

Divooka.DataAnalytics.DivookaDataGrid.CreateFromStringValues()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class with a single column containing string values.

Remarks

The column is named "Array" by default.

Parameters

NameDescriptionDefault
values An enumerable collection of string values to populate the single column.

Divooka.DataAnalytics.DivookaDataGrid.CreateFromIntValues()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class with a single column containing integer values.

Remarks

The column is named "Array" by default.

Parameters

NameDescriptionDefault
values An enumerable collection of integer values to populate the single column.

Divooka.DataAnalytics.DivookaDataGrid.CreateFromDoubleValues()

Initializes a new instance of the Divooka.DataAnalytics.DivookaDataGrid class with a single column containing double values.

Remarks

The column is named "Array" by default.

Parameters

NameDescriptionDefault
values An enumerable collection of double values to populate the single column.

Divooka.DataAnalytics.DivookaDataGrid.TableName

Name of the data grid.

Divooka.DataAnalytics.DivookaDataGrid.Columns

Columns of the data grid

Divooka.DataAnalytics.DivookaDataGrid.OptionalRowHeaderColumn

Index/Header of the rows

Divooka.DataAnalytics.DivookaDataGrid.Item()

Retrieves a column by its name. Returns null if no column with the specified name exists.

Parameters

NameDescriptionDefault
columnName The name of the column to retrieve.

Returns

A Divooka.DataAnalytics.DivookaDataColumn if found; otherwise, null.

Divooka.DataAnalytics.DivookaDataGrid.Item()

Retrieves a column by its index.

Parameters

NameDescriptionDefault
columnIndex The zero-based index of the column.

Returns

The Divooka.DataAnalytics.DivookaDataColumn at the specified index.

Divooka.DataAnalytics.DivookaDataGrid.Item()

Retrieves a subset of rows from the data grid, based on the specified index range.

Parameters

NameDescriptionDefault
start The starting index (inclusive).
end The ending index (exclusive).

Returns

A new Divooka.DataAnalytics.DivookaDataGrid containing rows in the specified range.

Divooka.DataAnalytics.DivookaDataGrid.ColumnCount

Get column count.

Divooka.DataAnalytics.DivookaDataGrid.ColumnHeaders

Get column headers.

Divooka.DataAnalytics.DivookaDataGrid.HasColumn()

Checks whether column with given name is present.

Parameters

NameDescriptionDefault
name

Returns

Divooka.DataAnalytics.DivookaDataGrid.RowCount

Not including header row

Divooka.DataAnalytics.DivookaDataGrid.Rows

Remarks

When used in a foreach statement, can retrieve directly as IDictionary<string, object> instead of dynamic; Can also cast as ExpandoObject

Divooka.DataAnalytics.DivookaDataGrid.RowValues

Get rows as value objects.

Divooka.DataAnalytics.DivookaDataGrid.ToCSVText()

Convert DataGrid to CSV format

Parameters

NameDescriptionDefault
withColumnHeader

Divooka.DataAnalytics.DivookaDataGrid.ToPrologFacts()

Divooka.DataAnalytics.DivookaDataGrid.ToSQL()

To be used with low level Command series functions.

Remarks

This doesn't depend on any specific additional library and is entirely text based. For most efficiency, use specific data service provider's library and use parameterized arguments.

Divooka.DataAnalytics.DivookaDataGrid.SaveToCSVFile()

Saves the DataGrid as a CSV file at the specified output path.

Remarks

This method converts the DataGrid into a CSV format and writes it to the specified file. The CSV format follows standard conventions, including escaping necessary characters.

Parameters

NameDescriptionDefault
outputPath The full file path where the CSV file will be saved.

Divooka.DataAnalytics.DivookaDataGrid.GetDataColumn()

Retrieves a Divooka.DataAnalytics.DivookaDataColumn by its header name or index.

Remarks

If the parameter is a numeric string, it is treated as a column index. Otherwise, it is interpreted as a column header name.

Parameters

NameDescriptionDefault
headerOrIndex The header name or zero-based column index as a string.

Returns

The Divooka.DataAnalytics.DivookaDataColumn that matches the specified header or index, or null if no match is found.

Divooka.DataAnalytics.DivookaDataGrid.ToDataTable

Converts the DataGrid into a System.Data.DataTable representation.

Remarks

The method constructs a System.Data.DataTable where each column corresponds to a DataGrid column, and each row represents a data entry. Column names are processed to avoid invalid characters.

Returns

A System.Data.DataTable containing all the data from the DataGrid.

Divooka.DataAnalytics.DivookaDataGrid.Calculate()

Computes a new column dynamically by applying a function to each row.

Parameters

NameDescriptionDefault
newFieldName The name of the new computed column.
computeValue A function that takes a row as a dictionary and returns a computed value.

Divooka.DataAnalytics.DivookaDataGrid.Save()

Saves the current data grid as a CSV file at the specified path.

Parameters

NameDescriptionDefault
path The file path where the CSV should be saved.

Divooka.DataAnalytics.DivookaDataGrid.AddColumn()

Adds a new column to the data grid.

Parameters

NameDescriptionDefault
columnName The name of the new column.

Returns

Divooka.DataAnalytics.DivookaDataGrid.AddColumns()

Adds multiple columns to the data grid.

Parameters

NameDescriptionDefault
columnNames The names of the columns to be added.

Returns

An array of created Divooka.DataAnalytics.DivookaDataColumn instances.

Divooka.DataAnalytics.DivookaDataGrid.RemoveColumn()

Removes a column from the data grid.

Parameters

NameDescriptionDefault
extra The name of the column to be removed.

Returns

The removed Divooka.DataAnalytics.DivookaDataColumn, or null if not found.

Divooka.DataAnalytics.DivookaDataGrid.AddOptionalRowHeaderColumn()

Adds an optional row header column.

Parameters

NameDescriptionDefault
columnName The name of the optional row header column.

Divooka.DataAnalytics.DivookaDataGrid.AddColumnFrom()

Adds a new column based on a reference column, with a specified number of rows.

Parameters

NameDescriptionDefault
refColumn The reference column.
rowCount The number of rows to copy from the reference column, negative number indicate count from the end.
throwExceptionIfNotEnoughRows Whether to throw an exception if not enough rows are available

Returns

Divooka.DataAnalytics.DivookaDataGrid.Sort()

Sorts the data grid based on a specified column in ascending or descending order.

Parameters

NameDescriptionDefault
anchorColumnName The column name used as the sorting key.
reverseOrder If true, sorts in descending order; otherwise, ascending.

Divooka.DataAnalytics.DivookaDataGrid.ToDictionary

For two column data grid with first column as name

Returns

Returns a variant of strongly typed Dictionary type, e.g. Dictionary<string, string>, Dictionary<string, double>, etc.

Divooka.DataAnalytics.DivookaDataGrid.CovarianceMatrix

Divooka.DataAnalytics.DivookaDataGrid.GrowRowBehavior

Specifies the behavior for growing rows in a data grid.

Divooka.DataAnalytics.DivookaDataGrid.GrowRowBehavior.FillZero

New rows are filled with zero values.

Divooka.DataAnalytics.DivookaDataGrid.GrowRowBehavior.CopyAbove

New rows are filled by copying the values from the row above.

Divooka.DataAnalytics.DivookaDataGrid.GrowRowBehavior.LinearInterpolate

New rows are filled using linear interpolation between existing values.

Divooka.DataAnalytics.DivookaDataGrid.GrowRows()

Grows the data grid by adding the specified number of rows according to the given growth pattern.

Parameters

NameDescriptionDefault
count The number of rows to add.
growthPattern The pattern used to populate the new rows.

Divooka.DataAnalytics.DivookaDataGrid.Apply()

Applies a transformation function to each row in the data grid and returns a new Divooka.DataAnalytics.DivookaDataGrid with the transformed rows.

Remarks

This method currently materializes the result into an array, which may have efficiency concerns. Consider replacing ToArray() with IEnumerable for improved performance.

Parameters

NameDescriptionDefault
transform A function that takes a dynamic row object and returns a dictionary representing the transformed row.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid containing the transformed rows.

Divooka.DataAnalytics.DivookaDataGrid.InitializeFromCSV()

Resets/Initializes current data grid from CSV.

Divooka.DataAnalytics.DivookaDataGrid.GetColumnInfoForDisplay

Generates a dictionary mapping processed column names to their respective Divooka.DataAnalytics.DivookaDataGrid.ColumnInfo structures.

Returns

A dictionary where the keys are processed column names (for display) and the values are Divooka.DataAnalytics.DivookaDataGrid.ColumnInfo instances containing column metadata.

Divooka.DataAnalytics.DivookaDataGrid.PreProcessColumnNameForDisplay()

Remarks

Needed only for WPF because its data grid system is too dumb TODO: Replace this completely and allow headers to be named as anything and displayed as is.

Parameters

NameDescriptionDefault
original
nameCounter

Returns

Divooka.DataAnalytics.DivookaDataGrid.EscapeSqlServerId()

Remarks

bare=true → no [ ]

Divooka.DataAnalytics.DivookaDataGrid.EscapeSQLiteIdentifier()

Minimal identifier-escaping for SQLite. SQLite accets double-quotes, backticks (MySQL) or square brackets (Microsoft). Use two esacpe characters to escape the escape character itself

Divooka.DataAnalytics.DivookaDataGrid.EscapeSQLiteValue()

Escapes a value for a SQLite INSERT statement. Null => NULL Otherwise single-quoted, with single quotes escaped. Numbers could be unquoted, but we keep it simple here and always quote.

Divooka.DataAnalytics.DivookaDataGridTransformation

DataGrid extension; Immutable operations

Divooka.DataAnalytics.DivookaDataGridTransformation.Range()

Take range of rows from original data grid.

Parameters

NameDescriptionDefault
dataGrid
start
end

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Trim()

Trim data grid by removing start and ending rows.

Parameters

NameDescriptionDefault
dataGrid
skipStart
skipEnd

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.TakeRows()

Similar to "trim"

Parameters

NameDescriptionDefault
dataGrid
rowCount Positive number indicate take from the start, negative number indicate take from the end.

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Head()

Take the first N rows from the data grid. Do not throw exception if not enough rows are available.

Parameters

NameDescriptionDefault
dataGrid Input data.
rowCount Number of rows to take. Use 1 to take the first row.

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Tail()

Take the last N rows from the data grid. Do not throw exception if not enough rows are available.

Parameters

NameDescriptionDefault
dataGrid Input data.
rowCount Number of rows to take. Use 1 to take the last row.

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Rename()

Renames specified columns in the given Divooka.DataAnalytics.DivookaDataGrid.

Parameters

NameDescriptionDefault
dataGrid The data grid to modify.
originalColumnNames An array of original column names to be renamed.
newColumnNames An array of new column names.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid with renamed columns.

Divooka.DataAnalytics.DivookaDataGridTransformation.Sort()

Sorts a Divooka.DataAnalytics.DivookaDataGrid based on the specified anchor column.

Parameters

NameDescriptionDefault
dataGrid The data grid to sort.
anchorColumnName The name of the column to use as the sorting anchor.
reverseOrder Indicates whether to sort in descending order (true) or ascending order (false).

Returns

A new Divooka.DataAnalytics.DivookaDataGrid sorted by the specified column.

Divooka.DataAnalytics.DivookaDataGridTransformation.Append()

Appends multiple Divooka.DataAnalytics.DivookaDataGrid objects into a single data grid.

Parameters

NameDescriptionDefault
dataGrids An array of data grids to append.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid that combines all input data grids.

Divooka.DataAnalytics.DivookaDataGridTransformation.AddSum()

Adds a new column to the Divooka.DataAnalytics.DivookaDataGrid with the sum of each numeric column.

Parameters

NameDescriptionDefault
dataGrid The input data grid.

Returns

A new data grid with additional sum columns.

Divooka.DataAnalytics.DivookaDataGridTransformation.ToVector()

Remarks

An alternative way to implement this is as explicit constructor on the Vector class, which is not recommended - we prefer DataGrid depending on Vector than the other way around.

Parameters

NameDescriptionDefault
dataColumn The data column to convert.

Returns

A Divooka.Matrix.DivookaVector representation of the column.

Divooka.DataAnalytics.DivookaDataGridTransformation.MakeCopy()

Creates a deep copy of the given Divooka.DataAnalytics.DivookaDataGrid.

Parameters

NameDescriptionDefault
dataGrid The data grid to copy.

Returns

A new instance of Divooka.DataAnalytics.DivookaDataGrid with copied data.

Divooka.DataAnalytics.DivookaDataGridTransformation.Append()

Appends the columns of another Divooka.DataAnalytics.DivookaDataGrid to a copy of the current one.

Parameters

NameDescriptionDefault
dataGrid The base data grid.
other The data grid to append.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid containing columns from both.

Divooka.DataAnalytics.DivookaDataGridTransformation.ExtractColumn()

Extracts a specific column from the Divooka.DataAnalytics.DivookaDataGrid by name.

Parameters

NameDescriptionDefault
dataGrid The data grid.
name The name of the column to extract.

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Extract()

Extracts a subset of columns from the Divooka.DataAnalytics.DivookaDataGrid. Can be used to extract or reorder fields

Parameters

NameDescriptionDefault
dataGrid The data grid.
columnNames The names of the columns to extract.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid containing only the extracted columns.

Divooka.DataAnalytics.DivookaDataGridTransformation.Extract()

Extracts a column from the Divooka.DataAnalytics.DivookaDataGrid by index.

Parameters

NameDescriptionDefault
dataGrid The data grid.
index The index of the column to extract.

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Extract()

Extracts a vector representation of a column by index.

Parameters

NameDescriptionDefault
dataGrid The data grid.
columnIndex The index of the column.

Returns

A Divooka.Matrix.DivookaVector representation of the column.

Divooka.DataAnalytics.DivookaDataGridTransformation.TakeColumnAsVector()

Extracts a vector from the specified Divooka.DataAnalytics.DivookaDataGrid by column index.

Parameters

NameDescriptionDefault
dataGrid The data grid from which to extract the vector.
index The zero-based index of the column to extract.

Returns

A Divooka.Matrix.DivookaVector representing the extracted column.

Divooka.DataAnalytics.DivookaDataGridTransformation.TakeColumnAsVector()

Extracts a vector from the specified Divooka.DataAnalytics.DivookaDataGrid by column name.

Parameters

NameDescriptionDefault
dataGrid The data grid from which to extract the vector.
name The name of the column to extract.

Returns

A Divooka.Matrix.DivookaVector representing the extracted column.

Divooka.DataAnalytics.DivookaDataGridTransformation.Exclude()

Creates a new Divooka.DataAnalytics.DivookaDataGrid excluding the specified column indices.

Parameters

NameDescriptionDefault
dataGrid The data grid to process.
columnIndex A collection of column indices to exclude.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid without the specified columns.

Divooka.DataAnalytics.DivookaDataGridTransformation.ConvertDateColumnToString()

Converts a DateTime or DateOnly column to a string column with a custom format. Common examples: yyyy-MM-dd HH:mm:ss

Parameters

NameDescriptionDefault
dataGrid The data grid.
columnName The name of the date column to convert.
format The date format string.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid with the formatted date column.

Divooka.DataAnalytics.DivookaDataGridTransformation.ConvertColumn()

Convert column to target type, with invalid data (either due to mising or incompatible) handling policy.

Remarks

If invalidValuePolicy is Divooka.DataAnalytics.DivookaDataColumn.AdvancedInvalidValueTypeHandlingPolicy.Drop, rows with invalid values are removed. Otherwise, values are handled according to the provided policy.

Parameters

NameDescriptionDefault
dataGrid The source Divooka.DataAnalytics.DivookaDataGrid to process.
columnName The name of the column to convert.
targetType The target System.Type to convert the column values to.
invalidValuePolicy The policy to handle invalid values encountered during conversion.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid with the specified column converted to the target type.

Divooka.DataAnalytics.DivookaDataGridTransformation.Exclude()

Excludes a subset of columns from the Divooka.DataAnalytics.DivookaDataGrid.

Parameters

NameDescriptionDefault
dataGrid The data grid.
columnNames The names of the columns to exclude.

Returns

A new Divooka.DataAnalytics.DivookaDataGrid without the specified columns.

Divooka.DataAnalytics.DivookaDataGridTransformation.FormatColumn()

Formats a number column into string

Parameters

NameDescriptionDefault
dataGrid
columnName
numberFormat A string formatting with `{0}` representing the number.

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Transpose()

Transpose has undefined behavior on data grids without column headers.

Parameters

NameDescriptionDefault
dataGrid
dedicatedHeaderRow

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Pivot()

Pivot existing table and transform rows onto columns. Notice very likely end result columns do not have matching size!

Parameters

NameDescriptionDefault
dataGrid
groupName
extractColumn

Returns

Divooka.DataAnalytics.DivookaDataGridTransformation.Pivot()

Pivot existing table and transform rows onto columns. Fill with null for missing values. THIS FUNCTION IS NOT FULLY IMPLEMENTED. AGGREGATTE FUNCTION IS IGNORED AT THE MOMENT.

Parameters

NameDescriptionDefault
dataGrid
indexColumn
groupName
extractColumn
aggregateFunction
zeroFill For NaN, fill with zero (for numbers) instead of null.

Returns

Divooka.DataAnalytics.Extensions.DataTableExtensions.Unwrap``1()

Retrieve a list of objects for target type using reflection from the data table; Type must have public properties; Property names are case insensitive

Divooka.DataAnalytics.Extensions.DataTableExtensions.Single``1()

Get a single value of given type from the single cell of the read result; Throw exception when invalid

Divooka.DataAnalytics.Extensions.DataTableExtensions.List``1()

Extract a list of single type of values from a data table

Divooka.DataAnalytics.Helpers.ConversionHelpers.GetExcelColumnName()

Gets the column name (column letter) for a given column index.

Parameters

NameDescriptionDefault
columnNumber The 1-based column index (A = 1, B = 2, etc.).
zeroIndexed Indicates whether the input column index is zero-based.

Returns

The Excel-style column name (e.g., A, B, AA, AB).

Divooka.DataAnalytics.Helpers.ConversionHelpers.GetExcelColumnIndex()

Converts an Excel-style column name (e.g., "A", "B", "AA") into its corresponding column index.

Parameters

NameDescriptionDefault
columnName The column name to convert.
zeroIndexed Indicates whether the output index should be zero-based.

Returns

The corresponding column index (1-based or 0-based depending on the zeroIndexed parameter).

Divooka.DataAnalytics.Helpers.ConversionHelpers.ParseExcelCellCoordinate()

Parses an Excel-style cell reference (e.g., "A1", "BC12") into its numeric row and column indices.

Parameters

NameDescriptionDefault
cell The cell reference string.
zeroIndexed Indicates whether the output row and column indices should be zero-based.

Returns

A tuple containing the parsed row and column indices.