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

Online Help

All Products    Maple    MapleSim


DataSeries/AreDuplicate

determine duplicate elements in a DataSeries

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

AreDuplicate( data )

Parameters

data

-

DataSeries

Description

• 

The AreDuplicate command returns a DataSeries of type truefalseFAIL where the elements correspond to true if the given element has duplicates in the DataSeries and false if the element is unique.

• 

The output from the AreDuplicate command can be used to index a DataSeries or DataFrame in order to return the duplicate elements in a given column.

Examples

DSDataSeries1,2,3,3,4,5,5,5

DS1122334354657585

(1)

The AreDuplicate command returns a truefalseFAIL DataSeries that shows any duplicate values as true.

AreDuplicateDS

1false2false3true4true5false6true7true8true

(2)

If the DataSeries is indexed by the result, a filtered DataSeries is returned that shows just the duplicate values:

DSAreDuplicateDS

3343657585

(3)

If a DataFrame is indexed by the result, a filtered DataFrame is returned that shows only the rows with duplicates in a given column.

DFDataFrame1,1,2,3,3,4|5,3,6,2,1,4|6,5,1,4,9,9|4,2,1,7,8,3

DF1234115642135232611432475319864493

(4)

For example, the following shows just the rows with duplicate elements in the first column:

DFAreDuplicateDF1

123411564213524324753198

(5)

This can also be combined with other queries in order to show rows that meet a given criteria. For example, to see which rows have duplicate elements in the first column and are greater than 2:

DF[ AreDuplicate( DF[1] ) and DF[1] >~ 2 ];

12344324753198

(6)

Compatibility

• 

The DataSeries/AreDuplicate command was introduced in Maple 2016.

• 

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

See Also

AreUnique

type/truefalseFAIL