FloatColumn
Defined in: src/dataframe/column.ts:484
Strongly-typed column. Use get and set to access elements by index.
Extends
Column<number>
Constructors
Constructor
new FloatColumn(
dart):FloatColumn
Defined in: src/dataframe/column.ts:30
Parameters
| Parameter | Type |
|---|---|
dart | any |
Returns
FloatColumn
Inherited from
Properties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
dart | public | any | Column.dart | src/dataframe/column.ts:25 |
tags | public | any | Column.tags | src/dataframe/column.ts:27 |
temp | public | any | Column.temp | src/dataframe/column.ts:26 |
Accessors
categories
Get Signature
get categories():
string[]
Defined in: src/dataframe/column.ts:395
Returns all unique strings in a sorted order. Applicable to string column only.
Returns
string[]
Inherited from
colors
Get Signature
get colors():
any
Defined in: src/dataframe/column.ts:251
Returns
any
Inherited from
dataFrame
Get Signature
get dataFrame():
DataFrame
Defined in: src/dataframe/column.ts:206
Parent table
Returns
Inherited from
dialogs
Get Signature
get dialogs():
any
Defined in: src/dataframe/column.ts:246
Returns
any
Inherited from
doublePrecision
Get Signature
get doublePrecision():
boolean
Defined in: src/dataframe/column.ts:485
Returns
boolean
Set Signature
set doublePrecision(
enableDoublePrecision):void
Defined in: src/dataframe/column.ts:488
Parameters
| Parameter | Type |
|---|---|
enableDoublePrecision | boolean |
Returns
void
isCategorical
Get Signature
get isCategorical():
boolean
Defined in: src/dataframe/column.ts:182
Is the column categorical (string, boolean)
Returns
boolean
Inherited from
isEmpty
Get Signature
get isEmpty():
boolean
Defined in: src/dataframe/column.ts:359
Returns whether all values in the columns are empty.
Returns
boolean
Inherited from
isNumerical
Get Signature
get isNumerical():
boolean
Defined in: src/dataframe/column.ts:176
Is the column numerical (float, int, bigint, qnum)
Returns
boolean
Inherited from
isVirtual
Get Signature
get isVirtual():
boolean
Defined in: src/dataframe/column.ts:194
Is this column virtual
Returns
boolean
Inherited from
layoutColumnId
Get Signature
get layoutColumnId():
string
Defined in: src/dataframe/column.ts:222
Layout column ID
Returns
string
Set Signature
set layoutColumnId(
s):void
Defined in: src/dataframe/column.ts:226
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
void
Inherited from
length
Get Signature
get length():
number
Defined in: src/dataframe/column.ts:200
Number of elements
Returns
number
Inherited from
markers
Get Signature
get markers():
any
Defined in: src/dataframe/column.ts:256
Returns
any
Inherited from
max
Get Signature
get max():
number
Defined in: src/dataframe/column.ts:424
Column's maximum value. The result is cached.
Returns
number
Inherited from
meta
Get Signature
get meta():
ColumnMetaHelper
Defined in: src/dataframe/column.ts:36
Returns
Inherited from
min
Get Signature
get min():
number
Defined in: src/dataframe/column.ts:421
Column's minimum value. The result is cached.
Returns
number
Inherited from
name
Get Signature
get name():
string
Defined in: src/dataframe/column.ts:231
Returns
string
Set Signature
set name(
s):void
Defined in: src/dataframe/column.ts:235
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
void
Inherited from
semType
Get Signature
get semType():
string
Defined in: src/dataframe/column.ts:212
Semantic type
Returns
string
Set Signature
set semType(
s):void
Defined in: src/dataframe/column.ts:216
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
void
Inherited from
stats
Get Signature
get stats():
Stats
Defined in: src/dataframe/column.ts:434
Basic descriptive statistics. The result is cached.
Returns
Inherited from
type
Get Signature
get type():
"string"|"bigint"|"object"|"int"|"double"|"bool"|"byte_array"|"datetime"|"qnum"|"dataframe"
Defined in: src/dataframe/column.ts:188
Column data type.
Returns
"string" | "bigint" | "object" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe"
Inherited from
valueComparer
Get Signature
get valueComparer():
Comparer|null
Defined in: src/dataframe/column.ts:417
Value comparison function to be used for sorting. Null means default sorting. Sample: https://public.datagrok.ai/js/samples/data-frame/sorting/custom-comparer
Returns
Comparer | null
Set Signature
set valueComparer(
cmp):void
Defined in: src/dataframe/column.ts:418
Parameters
| Parameter | Type |
|---|---|
cmp | Comparer | null |
Returns
void
Inherited from
version
Get Signature
get version():
number
Defined in: src/dataframe/column.ts:241
Version of the column. Increases each time the column was changed
Returns
number
Inherited from
Methods
aggregate()
aggregate(
type):any
Defined in: src/dataframe/column.ts:472
Aggregates a column using the [type] function, which corresponds to
- [DG.AGG] for int, bigint, float, qnum columns,
- [DG.STR_AGG] and [DG.STAT_COUNTS] for string columns,
- [DG.STAT_COUNTS], [DG.AGG.MIN], [DG.AGG.MAX], [DG.AGG.AVG] for datetime columns,
- [DG.AGG.TOTAL_COUNT] and [DG.AGG.MISSING_VALUE_COUNT] for virtual columns.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
any
Inherited from
applyFormula()
applyFormula(
formula,type?,treatAsString?):Promise<Column<any,any> |null>
Defined in: src/dataframe/column.ts:448
Applies the specified formula to a calculated column. Returns a new column object, if applied successfully, and null otherwise.
Parameters
| Parameter | Type | Default value |
|---|---|---|
formula | string | undefined |
type | "string" | "bigint" | "object" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | null | null |
treatAsString | boolean | false |
Returns
Promise<Column<any, any> | null>
Inherited from
asDoubleList()
asDoubleList():
Float32Array
Defined in: src/dataframe/column.ts:478
Returns
Float32Array
- typed array of float values representing the column. Does not guarantee to perform a copy of the underlying data.
Inherited from
clone()
clone(
mask?):Column<number>
Defined in: src/dataframe/column.ts:280
Performs deep cloning, optionally taking mask of the rows to be included. Note that the cloned colum is not added to this column's dataframe.
Parameters
| Parameter | Type |
|---|---|
mask? | BitSet |
Returns
Column<number>
Inherited from
compact()
compact():
any
Defined in: src/dataframe/column.ts:384
Compacts the internal column representation. Currently, it only affects string columns where values were modified.
Returns
any
Inherited from
convertTo()
convertTo(
newType,format?):Column
Defined in: src/dataframe/column.ts:457
Creates and returns a new column by converting [column] to the specified [newType].
Parameters
| Parameter | Type | Default value |
|---|---|---|
newType | string | undefined |
format | string | null | null |
Returns
Inherited from
fireValuesChanged()
fireValuesChanged():
void
Defined in: src/dataframe/column.ts:343
Call this method after setting elements without notifications via set
Returns
void
Inherited from
get()
get(
row):number|null
Defined in: src/dataframe/column.ts:318
Gets i-th value
Parameters
| Parameter | Type | Description |
|---|---|---|
row | number | row index |
Returns
number | null
- or null if isNone(i)
Inherited from
getCategory()
getCategory(
categoryIndex):string
Defined in: src/dataframe/column.ts:400
Returns i-th category. Applicable to string column only.
Parameters
| Parameter | Type |
|---|---|
categoryIndex | number |
Returns
string
Inherited from
getCategoryOrder()
getCategoryOrder():
string[]
Defined in: src/dataframe/column.ts:410
Gets order of categories
Returns
string[]
Inherited from
getNumber()
getNumber(
i):number
Defined in: src/dataframe/column.ts:329
Returns i-th value as number. None if isNone(i)
Parameters
| Parameter | Type |
|---|---|
i | number |
Returns
number
Inherited from
getRawData()
getRawData():
Int32Array<ArrayBufferLike> |Uint32Array<ArrayBufferLike> |Float32Array<ArrayBufferLike> |Float64Array<ArrayBufferLike>
Defined in: src/dataframe/column.ts:294
FOR EXPERT USE ONLY!
Returns the raw buffer containing data. Sample: https://public.datagrok.ai/js/samples/data-frame/performance/access Return type depends on the column type: {Int32Array} for ints, INT_NULL represents null. {Float32Array} or {Float64Array} for floats depending on doublePrecision parameter, FLOAT_NULL represents null. {Float64Array} for qnums, FLOAT_NULL represents null. {Float64Array} for datetime, in microseconds since epoch, FLOAT_NULL represents null. {Int32Array} for strings indexes of categories. {Uint32Array} bit array.
Returns
Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>
Inherited from
getSortedOrder()
getSortedOrder():
Int32Array
Defined in: src/dataframe/column.ts:413
Returns an array of indexes sorted using [valueComparer].
Returns
Int32Array
Inherited from
getString()
getString(
i):string
Defined in: src/dataframe/column.ts:324
Returns i-th value as string, taking into account value format defined for the column. An empty string is returned if there is no value.
Parameters
| Parameter | Type |
|---|---|
i | number |
Returns
string
Inherited from
getTag()
getTag(
tag):string
Defined in: src/dataframe/column.ts:369
Returns the value of the specified tag, or null if the tag is not present.
Parameters
| Parameter | Type |
|---|---|
tag | string |
Returns
string
Inherited from
init()
init(
valueInitializer):Column
Defined in: src/dataframe/column.ts:264
Initializes all values in the column to [columnInitializer].
Parameters
| Parameter | Type | Description |
|---|---|---|
valueInitializer | string | number | boolean | Date | Dayjs | ((ind) => any) | null | value, or a function that returns value by index |
Returns
Inherited from
isNone()
isNone(
i):boolean
Defined in: src/dataframe/column.ts:364
Returns whether i-th value is missing.
Parameters
| Parameter | Type |
|---|---|
i | number |
Returns
boolean
Inherited from
matches()
matches(
filter):boolean
Defined in: src/dataframe/column.ts:429
Checks whether the column passes the specified [filter]. [filter] can be either specific data [type] such as 'int' or 'string', more broadly - 'numerical', or 'categorical', or null for any columns.
Parameters
| Parameter | Type |
|---|---|
filter | "string" | "bigint" | "object" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | "categorical" | "numerical" | null |
Returns
boolean
Inherited from
scale()
scale(
idx):number
Defined in: src/dataframe/column.ts:307
Linearly maps idx-th value to the [0,1] interval, where 0 represents column minimum, and 1 represents maximum.
Parameters
| Parameter | Type |
|---|---|
idx | number |
Returns
number
Inherited from
set()
set(
i,value,notify?):void
Defined in: src/dataframe/column.ts:354
Sets [i]-th value to [x], and optionally notifies the dataframe about this change.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
i | number | undefined | Row index. |
value | number | null | undefined | Value to set. |
notify | boolean | true | whether DataFrame's changed event should be fired. Call fireValuesChanged after you are done modifying the column. |
Returns
void
Inherited from
setCategoryOrder()
setCategoryOrder(
order):void
Defined in: src/dataframe/column.ts:405
Sets order of categories
Parameters
| Parameter | Type |
|---|---|
order | string[] |
Returns
void
Inherited from
setRawData()
setRawData(
rawData,notify?):void
Defined in: src/dataframe/column.ts:311
Parameters
| Parameter | Type | Default value |
|---|---|---|
rawData | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | undefined |
notify | boolean | true |
Returns
void
Inherited from
setString()
setString(
i,str,notify?):boolean
Defined in: src/dataframe/column.ts:338
Attempts to set i-th value by converting a provided string to the corresponding strongly-typed value. Returns true if text was successfully parsed and set, otherwise false. Examples: dateColumn.setString('April 1, 2020'); intColumn.setString('42');
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
i | number | undefined | - |
str | string | undefined | - |
notify | boolean | true | whether DataFrame's changed event should be fired |
Returns
boolean
Inherited from
setTag()
setTag(
tag,value):Column
Defined in: src/dataframe/column.ts:377
Sets a tag to the specified value.
Parameters
| Parameter | Type | Description |
|---|---|---|
tag | string | Key. |
value | string | Value. |
Returns
. *
Inherited from
toList()
toList():
any[]
Defined in: src/dataframe/column.ts:390
Copies column values to an array. Avoid using this method for performance-critical routines; consider using getRawData
Returns
any[]
Inherited from
toString()
toString():
string
Defined in: src/dataframe/column.ts:462
Returns
string
- string representation of this column
Inherited from
values()
values():
Generator<number|null,void,unknown>
Defined in: src/dataframe/column.ts:440
An iterator over all values in this column.
Returns
Generator<number | null, void, unknown>
Inherited from
bool()
staticbool(name,length?):Column<boolean>
Defined in: src/dataframe/column.ts:138
Creates a boolean column with the specified name and length.
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
length | number | 0 |
Returns
Column<boolean>
Inherited from
dataFrame()
Defined in: src/dataframe/column.ts:148
Creates a column containing dataframes with the specified name and length.
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
length | number | 0 |
Returns
Inherited from
dateTime()
staticdateTime(name,length?):Column
Defined in: src/dataframe/column.ts:143
Creates a datetime column with the specified name and length.
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
length | number | 0 |
Returns
Inherited from
float()
staticfloat(name,length?):Column<number>
Defined in: src/dataframe/column.ts:128
Creates a floating point column with the specified name and length.
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
length | number | 0 |
Returns
Column<number>
Inherited from
fromBigInt64Array()
staticfromBigInt64Array(name,array):Column<any,any>
Defined in: src/dataframe/column.ts:87
Creates BigIntColumn from BigInt64Array / BigUint64Array
Parameters
| Parameter | Type |
|---|---|
name | string |
array | BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike> |
Returns
Column<any, any>
Inherited from
fromBitSet()
staticfromBitSet(name,bitset):Column<boolean>
Defined in: src/dataframe/column.ts:118
Creates a Column from the bitset.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | column name |
bitset | BitSet | bitset. The resulting boolean column will be of length bitset.length |
Returns
Column<boolean>
Inherited from
fromFloat32Array()
staticfromFloat32Array(name,array,length?):Column<number>
Defined in: src/dataframe/column.ts:77
[array] will be not be copied and will be used as column's storage
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
array | Float32Array | undefined |
length | number | null | null |
Returns
Column<number>
Inherited from
fromFloat64Array()
staticfromFloat64Array(name,array,length?):Column<number>
Defined in: src/dataframe/column.ts:82
[array] will be not be copied and will be used as column's storage
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
array | Float64Array | undefined |
length | number | null | null |
Returns
Column<number>
Inherited from
fromIndexes()
staticfromIndexes(name,categories,indexes):Column
Defined in: src/dataframe/column.ts:110
Crates a Column of string type from categories and indexes
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | - |
categories | string[] | - |
indexes | Int32Array | - |
Returns
Inherited from
fromInt32Array()
staticfromInt32Array(name,array,length?):Column<number>
Defined in: src/dataframe/column.ts:72
[array] will be not be copied and will be used as column's storage
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
array | Int32Array | undefined |
length | number | null | null |
Returns
Column<number>
Inherited from
fromList()
staticfromList(type,name,list):Column
Defined in: src/dataframe/column.ts:98
Creates a Column from the list of values.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | "string" | "bigint" | "object" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | - |
name | string | column name |
list | any[] | list of values |
Returns
See
Inherited from
fromStrings()
staticfromStrings(name,list):Column
Defined in: src/dataframe/column.ts:54
Creates a Column from the list of string values Please note that method performs type promotion if all listed values are numeric
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Column name |
list | string[] | List of column values https://dev.datagrok.ai/script/samples/javascript/data-frame/construction/create-from-columns https://dev.datagrok.ai/script/samples/javascript/data-frame/construction/create-from-arrays |
Returns
Inherited from
fromType()
staticfromType(type,name?,length?):Column
Defined in: src/dataframe/column.ts:67
Creates a Column with explicitly specified type
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
type | "string" | "bigint" | "object" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | undefined | column type code COLUMN_TYPE |
name? | string | null | undefined | Column name |
length? | number | 0 | Column length (should match row count of the data frame ) DataFrame.create |
Returns
See
COLUMN_TYPE
Inherited from
int()
staticint(name,length?):Column<number>
Defined in: src/dataframe/column.ts:123
Creates an integer column with the specified name and length.
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
length | number | 0 |
Returns
Column<number>
Inherited from
qnum()
staticqnum(name,length?,values?,exact?):Column<number>
Defined in: src/dataframe/column.ts:161
Creates a qualified number column with the specified name and length. Initialized values with [values], if it is specified; strips out the qualifier part if [exact] is true.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
name | string | undefined | - |
length | number | 0 | - |
values | number[] | [] | - |
exact | boolean | true | if true, strips out qualifier from [values]. |
Returns
Column<number>
Inherited from
string()
staticstring(name,length?):Column<string>
Defined in: src/dataframe/column.ts:133
Creates a string column with the specified name and length.
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
length | number | 0 |
Returns
Column<string>