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.
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
What kind of issue would you like to report? (Optional)