determine duplicate rows in a DataFrame
AreDuplicate( data )
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
The AreDuplicate command returns a truefalseFAIL DataSeries that shows duplicate rows as true and unique rows as false.
If the DataFrame is indexed by the result, a filtered DataFrame is returned that shows just the duplicate rows:
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 ) and DF <~ 6 ];
The DataFrame/AreDuplicate command was introduced in Maple 2016.
For more information on Maple 2016 changes, see Updates in Maple 2016.
Download Help Document