DataFrameColumn
Defined in: js-api/src/dataframe/column.ts:554
Column of type [DataFrame].
Extends
Constructors
Constructor
new DataFrameColumn(
dart):DataFrameColumn
Defined in: js-api/src/dataframe/column.ts:32
Parameters
| Parameter | Type |
|---|---|
dart | any |
Returns
DataFrameColumn
Inherited from
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
dart | public | any | - | Column.dart | js-api/src/dataframe/column.ts:25 |
tags | public | MapBag<string> | Metadata as string key-value pairs; persisted with the column. | Column.tags | js-api/src/dataframe/column.ts:29 |
temp | public | any | Auxiliary data that is not persisted (a MapBag: indexed access plus the map methods; typed any so it can be cast to a package's own shape). | Column.temp | js-api/src/dataframe/column.ts:27 |
Accessors
categories
Get Signature
get categories():
string[]
Defined in: js-api/src/dataframe/column.ts:373
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: js-api/src/dataframe/column.ts:232
Deprecated
Use meta.colors (ColumnMetaHelper.colors). Removed in 1.30.
Returns
any
Inherited from
dataFrame
Get Signature
get dataFrame():
DataFrame
Defined in: js-api/src/dataframe/column.ts:190
Parent table
Returns
Inherited from
dialogs
Get Signature
get dialogs():
any
Defined in: js-api/src/dataframe/column.ts:227
Deprecated
Use meta.dialogs (ColumnMetaHelper.dialogs). Removed in 1.30.
Returns
any
Inherited from
isCategorical
Get Signature
get isCategorical():
boolean
Defined in: js-api/src/dataframe/column.ts:170
Is the column categorical (string, boolean)
Returns
boolean
Inherited from
isEmpty
Get Signature
get isEmpty():
boolean
Defined in: js-api/src/dataframe/column.ts:337
Returns whether all values in the columns are empty.
Returns
boolean
Inherited from
isNumerical
Get Signature
get isNumerical():
boolean
Defined in: js-api/src/dataframe/column.ts:165
Is the column numerical (float, int, bigint, qnum)
Returns
boolean
Inherited from
isVirtual
Get Signature
get isVirtual():
boolean
Defined in: js-api/src/dataframe/column.ts:180
Is this column virtual
Returns
boolean
Inherited from
layoutColumnId
Get Signature
get layoutColumnId():
string
Defined in: js-api/src/dataframe/column.ts:204
Layout column ID
Returns
string
Set Signature
set layoutColumnId(
s):void
Defined in: js-api/src/dataframe/column.ts:208
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
void
Inherited from
length
Get Signature
get length():
number
Defined in: js-api/src/dataframe/column.ts:185
Number of elements
Returns
number
Inherited from
markers
Get Signature
get markers():
any
Defined in: js-api/src/dataframe/column.ts:237
Deprecated
Use meta.markers (ColumnMetaHelper.markers). Removed in 1.29.
Returns
any
Inherited from
max
Get Signature
get max():
number
Defined in: js-api/src/dataframe/column.ts:402
Column's maximum value. The result is cached.
Returns
number
Inherited from
meta
Get Signature
get meta():
ColumnMetaHelper
Defined in: js-api/src/dataframe/column.ts:38
Returns
Inherited from
min
Get Signature
get min():
number
Defined in: js-api/src/dataframe/column.ts:399
Column's minimum value. The result is cached.
Returns
number
Inherited from
name
Get Signature
get name():
string
Defined in: js-api/src/dataframe/column.ts:213
Returns
string
Set Signature
set name(
s):void
Defined in: js-api/src/dataframe/column.ts:217
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
void
Inherited from
semType
Get Signature
get semType():
string
Defined in: js-api/src/dataframe/column.ts:195
Semantic type
Returns
string
Set Signature
set semType(
s):void
Defined in: js-api/src/dataframe/column.ts:199
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
void
Inherited from
stats
Get Signature
get stats():
Stats
Defined in: js-api/src/dataframe/column.ts:412
Basic descriptive statistics. The result is cached.
Returns
Inherited from
type
Get Signature
get type():
"string"|"bigint"|"object"|"bool"|"int"|"double"|"byte_array"|"datetime"|"qnum"|"dataframe"
Defined in: js-api/src/dataframe/column.ts:175
Column data type.
Returns
"string" | "bigint" | "object" | "bool" | "int" | "double" | "byte_array" | "datetime" | "qnum" | "dataframe"
Inherited from
valueComparer
Get Signature
get valueComparer():
Comparer|null
Defined in: js-api/src/dataframe/column.ts:395
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: js-api/src/dataframe/column.ts:396
Parameters
| Parameter | Type |
|---|---|
cmp | Comparer | null |
Returns
void
Inherited from
version
Get Signature
get version():
number
Defined in: js-api/src/dataframe/column.ts:222
Version of the column. Increases each time the column was changed
Returns
number
Inherited from
Methods
aggregate()
aggregate(
type):any
Defined in: js-api/src/dataframe/column.ts:450
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 | ColumnAggregationType |
Returns
any
Inherited from
applyFormula()
applyFormula(
formula,type?,treatAsString?):Promise<Column<any,any> |null>
Defined in: js-api/src/dataframe/column.ts:426
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" | "bool" | "int" | "double" | "byte_array" | "datetime" | "qnum" | "dataframe" | null | null |
treatAsString | boolean | false |
Returns
Promise<Column<any, any> | null>
Inherited from
asDoubleList()
asDoubleList():
Float32Array
Defined in: js-api/src/dataframe/column.ts:456
Returns
Float32Array
typed array of float values representing the column. Does not guarantee to perform a copy of the underlying data.
Inherited from
clone()
Defined in: js-api/src/dataframe/column.ts:260
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
Inherited from
compact()
compact():
any
Defined in: js-api/src/dataframe/column.ts:362
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: js-api/src/dataframe/column.ts:435
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: js-api/src/dataframe/column.ts:322
Call this method after setting elements without notifications via set
Returns
void
Inherited from
get()
get(
row):DataFrame|null
Defined in: js-api/src/dataframe/column.ts:556
Gets [i]-th value.
Parameters
| Parameter | Type |
|---|---|
row | number |
Returns
DataFrame | null
Overrides
getCategory()
getCategory(
categoryIndex):string
Defined in: js-api/src/dataframe/column.ts:378
Returns i-th category. Applicable to string column only.
Parameters
| Parameter | Type |
|---|---|
categoryIndex | number |
Returns
string
Inherited from
getCategoryOrder()
getCategoryOrder():
string[]
Defined in: js-api/src/dataframe/column.ts:388
Gets order of categories
Returns
string[]
Inherited from
getNumber()
getNumber(
i):number
Defined in: js-api/src/dataframe/column.ts:308
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: js-api/src/dataframe/column.ts:272
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: js-api/src/dataframe/column.ts:391
Returns an array of indexes sorted using [valueComparer].
Returns
Int32Array
Inherited from
getString()
getString(
i):string
Defined in: js-api/src/dataframe/column.ts:303
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: js-api/src/dataframe/column.ts:347
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: js-api/src/dataframe/column.ts:244
Initializes all values in the column to [columnInitializer].
Parameters
| Parameter | Type | Description |
|---|---|---|
valueInitializer | string | number | boolean | Dayjs | Date | ((ind) => any) | null | value, or a function that returns value by index |
Returns
Inherited from
isNone()
isNone(
i):boolean
Defined in: js-api/src/dataframe/column.ts:342
Returns whether i-th value is missing.
Parameters
| Parameter | Type |
|---|---|
i | number |
Returns
boolean
Inherited from
matches()
matches(
filter):boolean
Defined in: js-api/src/dataframe/column.ts:407
Checks whether the column passes the specified [filter]. [filter] can be either specific data [type] such as 'int' or 'string', more broadly - 'numerical', 'numerical_no_datetime', or 'categorical', or null for any columns.
Parameters
| Parameter | Type |
|---|---|
filter | ColumnTypeFilter | null |
Returns
boolean
Inherited from
scale()
scale(
idx):number
Defined in: js-api/src/dataframe/column.ts:285
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: js-api/src/dataframe/column.ts:332
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 | DataFrame | 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: js-api/src/dataframe/column.ts:383
Sets order of categories
Parameters
| Parameter | Type |
|---|---|
order | string[] |
Returns
void
Inherited from
setRawData()
setRawData(
rawData,notify?):void
Defined in: js-api/src/dataframe/column.ts:290
Replaces the underlying buffer (see getRawData); [notify] fires the change event.
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: js-api/src/dataframe/column.ts:317
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: js-api/src/dataframe/column.ts:355
Sets a tag to the specified value.
Parameters
| Parameter | Type | Description |
|---|---|---|
tag | string | Key. |
value | string | Value. |
Returns
Inherited from
toList()
toList():
DataFrame[]
Defined in: js-api/src/dataframe/column.ts:561
Returns all values as an array.
Returns
Overrides
toString()
toString():
string
Defined in: js-api/src/dataframe/column.ts:440
Returns
string
string representation of this column
Inherited from
values()
values():
Generator<DataFrame|null,void,unknown>
Defined in: js-api/src/dataframe/column.ts:418
An iterator over all values in this column.
Returns
Generator<DataFrame | null, void, unknown>
Inherited from
bool()
staticbool(name,length?):Column<boolean>
Defined in: js-api/src/dataframe/column.ts:132
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: js-api/src/dataframe/column.ts:142
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: js-api/src/dataframe/column.ts:137
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: js-api/src/dataframe/column.ts:122
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: js-api/src/dataframe/column.ts:85
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: js-api/src/dataframe/column.ts:112
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: js-api/src/dataframe/column.ts:75
[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: js-api/src/dataframe/column.ts:80
[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: js-api/src/dataframe/column.ts:105
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: js-api/src/dataframe/column.ts:70
[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: js-api/src/dataframe/column.ts:95
Creates a Column from the list of values.
Parameters
| Parameter | Type | Description |
|---|---|---|
type | "string" | "bigint" | "object" | "bool" | "int" | "double" | "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: js-api/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://public.datagrok.ai/js/samples/data-frame/construction/create-from-columns https://public.datagrok.ai/js/samples/data-frame/construction/create-from-arrays |
Returns
Inherited from
fromType()
staticfromType<T>(type,name?,length?):Column<T>
Defined in: js-api/src/dataframe/column.ts:65
Creates a Column with explicitly specified type
Type Parameters
| Type Parameter | Default type |
|---|---|
T | any |
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
type | "string" | "bigint" | "object" | "bool" | "int" | "double" | "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
Column<T>
See
COLUMN_TYPE
Inherited from
int()
staticint(name,length?):Column<number>
Defined in: js-api/src/dataframe/column.ts:117
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: js-api/src/dataframe/column.ts:151
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: js-api/src/dataframe/column.ts:127
Creates a string column with the specified name and length.
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
length | number | 0 |
Returns
Column<string>