I have a list like this:
rew={{{2011, 3, 13, 0, 0, 0}, 1044.4}, {{2011, 3, 13, 3, 0, 0}, Missing["NotAvailable"]},
{{2011, 3, 13, 3, 0, 0}, 1044.7}, {{2011, 3, 13, 6, 0, 0}, 1043.4},
{{2011, 3, 13, 9, 0, 0},1041.5}, {{2011, 3, 13, 12, 0, 0}, 1044.1},
{{2011, 3, 13, 15, 0, 0}, 1045.4}, {{2011, 3, 13, 18, 0, 0}, 1046.8},
{{2011, 3, 13, 21, 0, 0}, 1047.5},.....}
How do I delete duplicated sublists?
From this list I want to delete
{{2011, 3, 13, 3, 0, 0}, Missing["NotAvailable"]}, {{2011, 3, 13, 3, 0, 0}, 1044.7}
this sublists which have duplicates because the first part is the same. And also delete duplicates if I face the duplicates
{2011, 3, 13, 0, 0, 0}, 1044.4}a duplicate of? – Pinguin Dirk Nov 28 '13 at 07:08{2011, 3, 13, 3, 0, 0}(or rather keep one entry?)? Please confirm – Pinguin Dirk Nov 28 '13 at 07:34DeleteCases[GatherBy[rew, First@# &], datum_ /; Length[datum] != 1]– Aky Nov 28 '13 at 07:37DeleteDuplicates[rew, First@#1 == First@#2 &]. – Aky Nov 28 '13 at 07:56GatherBy[list, First][[;;, 1]]the second part of this question is yours question. – Kuba Nov 28 '13 at 08:16Missing? – Jacob Akkerboom Nov 28 '13 at 10:42