Data.deduplicate

Data.deduplicate(col, action='average', clone=True)

Remove rows with duplicated values in the given column.

Parameters:
  • datafile (Data) – Data object to work with if not being used as a bound method.

  • col (Index type) – Column to look for duplicate values.

Keyword Arguments:
  • action (str) –

    What to do with duplicate values:
    • average - work out the average of the rows which are duplicated

    • median - work out the median value of all the rows with duplicate search column values

    • first, last - use the first or last value of duplicated search column values

  • clone (bool) – Return a clone of the current AnalysisMixin with depuplicated data (True) or just the data (False).

Returns:

(Stoner.Data or tuple of 4 array-like) – Either a clone of the current data set with the depuplciated data, or just a data array.