Find Unique Elements - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

DataSeries/AreUnique

determine unique elements in a DataSeries

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

AreUnique( data )

Parameters

data

-

DataSeries

options

-

options : (optional) equation(s) of the form option=value where option can be any of keep.

Options

• 

keep : first, last, none; if a duplicate element is encountered, keep specifies which duplicate to retain

Description

• 

The AreUnique command returns a DataSeries of type truefalseFAIL where the elements correspond to true if the given element is unique and false if the given element is a duplicate of another value in the given DataSeries.

• 

The output from the AreUnique command can be used to index a DataSeries or DataFrame in order to return the unique rows in a given column.

• 

The keep option allows for specification of which duplicate element value in the DataSeries to keep. By default, keep marks the first instance of a value that it encounters as unique (true) and marks any duplicates of this first instance as a duplicate (false). If keep is set to last, the last detected duplicate value is marked as unique (true) and any other matching values are marked as duplicate (false). If keep is set to none, any elements that have duplicates are marked as duplicates (false).

Examples

(1)

The AreUnique command returns a truefalseFAIL DataSeries that shows all unique values as true.

(2)

If the DataSeries is indexed by the result, a filtered DataSeries is returned that removes any duplicate values:

(3)

The results can be used to index a DataFrame and remove the rows that have duplicate values in a specific column.

(4)

(5)

The keep option allows for specification of which row to keep, either the first, last or none, when a duplicate is found:

(6)

(7)

If keep is set to none, all rows that have a duplicate value in a column are marked as false.

(8)

Compatibility

• 

The DataSeries/AreUnique command was introduced in Maple 2016.

• 

For more information on Maple 2016 changes, see Updates in Maple 2016.

See Also

AreDuplicate

type/truefalseFAIL

 


Download Help Document