Libraries.Compute.Statistics.DataFrameColumn Documentation

This class represents a column on the system. Columns do not have a type themselves, but all subclasses can be made to have any arbitrary type, even custom ones. Columns by default can accept calculations, which send elements to the calculation of the appropriate type and conduct operations. DataFrame objects use the appropriate subclass of column automatically when reading in data frames from disk, based upon the first item in the spreadsheet. Note that in most cases, a user will not interact directly with this class. It is a parent class that encapsulates some common functionality, but typically one would pass a calculation or other operation to this class. If one needs to directly manipulate the data in a particular column, then a subclass must be used.

Inherits from: Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
Add(text value)Columns may optionally add data from a text representation of that data.
Calculate(Libraries.Compute.Statistics.DataFrameColumnCalculation calculation)This action conducts a calculation on this column.
CanConvertToVector()This action returns whether or not this column type can be converted to a Vector of numbers.
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
ConvertToVector()Some column types can be converted to a raw vector of numbers.
Copy()This action conducts a deep copy of the column.
Copy(integer rowStart, integer rowEnd)This action does a deep copy of the row between the 0-indexed rowStart and rowEnd.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetAsNumber(integer index)Regardless of the type of the column, this action attempts to convert the item at the index to a number.
GetHashCode()This action gets the hash code for an object.
GetHeader()This gets the header for this column.
GetSize()This action returns the number of rows.
SendValueTo(integer index, Libraries.Compute.Statistics.DataFrameColumnCalculation calculation)This action sends an individual data point to a calculation, typed appropriately by its subclass.
SetHeader(text header)This sets the header for this column.
Swap(integer left, integer right)This action swaps two values in the column.

Actions Documentation

Add(text value)

Columns may optionally add data from a text representation of that data. This can be in any arbitrary format determined by the column implementor.

Parameters

Calculate(Libraries.Compute.Statistics.DataFrameColumnCalculation calculation)

This action conducts a calculation on this column. The calculation begins by issuing a Start action. Then if it is an iterable action, sends each data point to the class for processing. If not, it is asked to conduct the entire operation at once on the full data set. Finally, it issues an end action.

Parameters

CanConvertToVector()

This action returns whether or not this column type can be converted to a Vector of numbers.

Return

boolean:

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

ConvertToVector()

Some column types can be converted to a raw vector of numbers. All other column types throw an error if they cannot convert.

Return

Libraries.Compute.Vector:

Copy()

This action conducts a deep copy of the column.

Return

Libraries.Compute.Statistics.DataFrameColumn:

Copy(integer rowStart, integer rowEnd)

This action does a deep copy of the row between the 0-indexed rowStart and rowEnd.

Parameters

Return

Libraries.Compute.Statistics.DataFrameColumn:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(t)

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetAsNumber(integer index)

Regardless of the type of the column, this action attempts to convert the item at the index to a number. Attrribute: Parameter index the item to be converted

Parameters

Return

number:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode()

Return

integer: The integer hash code of the object.

GetHeader()

This gets the header for this column.

Return

text:

GetSize()

This action returns the number of rows.

Return

integer:

SendValueTo(integer index, Libraries.Compute.Statistics.DataFrameColumnCalculation calculation)

This action sends an individual data point to a calculation, typed appropriately by its subclass.

Parameters

SetHeader(text header)

This sets the header for this column.

Parameters

Swap(integer left, integer right)

This action swaps two values in the column.

Parameters