dups = [1,9,2,3,8,3,0,7,4,1,6,5,0,5] unique = [] for n in dups: if not n in unique: unique.append(n) print(dups) print(unique) This requires more lines written, but the numbers will not be sorted; as it will if we make a set from the list. Hth, cmiiw 21st Oct...
("Kate", "Smith", GenderEnum.Female, 21)) List.Add(New Person("Jenny", "Winston", GenderEnum.Female, 25)) Dim dups = (From l In List Group By l.Age Into Count Where Count > 1 Select Age).ToArray List.RemoveAll(Function(p) Return dups.Contains(p.Age) End Function) End Sub ...
{axis: [keyarr, indexer]}, copy=True, allow_dups=True ) def _getitem_tuple(self, tup: Tuple): def _getitem_tuple(self, tup: tuple): with suppress(IndexingError): return self._getitem_lowerdim(tup) Expand All @@ -1102,7 +1099,7 @@ def _get_label(self, label, axis: int): #...