DataSeries/AreDuplicate
determine duplicate elements in a DataSeries
Calling Sequence
Parameters
Description
Examples
Compatibility
AreDuplicate( data )
data
-
DataSeries
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.
DS≔DataSeries⁡1,2,3,3,4,5,5,5
DS≔1122334354657585
The AreDuplicate command returns a truefalseFAIL DataSeries that shows any duplicate values as true.
AreDuplicate⁡DS
1false2false3true4true5false6true7true8true
If the DataSeries is indexed by the result, a filtered DataSeries is returned that shows just the duplicate values:
DSAreDuplicate⁡DS
3343657585
If a DataFrame is indexed by the result, a filtered DataFrame is returned that shows only the rows with duplicates in a given column.
DF≔DataFrame⁡1,1,2,3,3,4|5,3,6,2,1,4|6,5,1,4,9,9|4,2,1,7,8,3
DF≔1234115642135232611432475319864493
For example, the following shows just the rows with duplicate elements in the first column:
DFAreDuplicate⁡DF1
123411564213524324753198
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
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
Download Help Document