dataFrame.column — distinct()

Description

The distinct() method of the column object returns an array containing the unique values of the selected column.

Signature

dataFrame.column(columnName).distinct()
Scope
dataFrame
Family
column
Returns
array

Argument

columnName (string)
The name of the column from which to retrieve unique values.

Returns

uniqueValues (array)
An array containing the unique values of the selected column.

Example

// get the unique values of a 'revenue' column of the dataFrame
var uniqueValues = df.column('revenue').distinct();

// log the unique values
notebook.log(uniqueValues);