DataFrame/AreDuplicate
determine duplicate rows in a DataFrame
Calling Sequence
Parameters
Description
Examples
Compatibility
AreDuplicate( data )
data
-
DataFrame
The AreDuplicate command returns a DataSeries of type truefalseFAIL where the elements correspond to true if the corresponding row has duplicates in the DataSeries and false if the row is unique.
The output from the AreDuplicate command can be used to index a DataFrame in order to return the duplicate rows.
The following DataFrame has one duplicate row; the fourth row is the same as the first.
DF≔DataFrame⁡1,1,2,1,3,4|6,5,1,6,9,9|4,2,1,4,8,3
DF≔123116421523211416453986493
The AreDuplicate command returns a truefalseFAIL DataSeries that shows duplicate rows as true and unique rows as false.
AreDuplicate⁡DF
1true2false3false4true5false6false
If the DataFrame is indexed by the result, a filtered DataFrame is returned that shows just the duplicate rows:
DFAreDuplicate⁡DF1
123116421524164
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 whose entries in the second column are less than 6:
DF[ AreDuplicate( DF[1] ) and DF[2] <~ 6 ];
1232152
The DataFrame/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