# Delete Duplicates by a distance test

Consider the following list which is of length 245:

list = {{1.7821782709267973, 1.782178215568537,
1.7821780839683263}, {4.632562813287688, 1.1067577689655785,
1.087587771271402}, {4.627734232255028, 1.1069014595131055,
1.0777279595894613}, {4.6317308706419995, 1.096541756979757,
1.0961872811010953}, {4.632423981962563, 1.097190827117355,
1.0969249027547516}, {4.627963538705377, 1.0926238830181279,
1.0925706503230255}, {4.629816058992955, 1.0944778417527588,
1.0944219685928114}, {4.630612831346933, 1.0952752844991205,
1.095216675396808}, {4.634369193140795, 1.099471779954157,
1.09853200574019}, {1.7821782241937663, 1.7821782217911688,
1.782178218526167}, {4.634250830189511, 1.1019074843793748,
1.096292161872628}, {4.634231247683334, 1.1010878292010011,
1.0966391582638046}, {4.633702274723675, 1.0991852018078798,
1.0974868921137435}, {4.629831492511016, 1.0945415201911441,
1.0943893264761089}, {4.631199467390834, 1.0958629597045486,
1.0958021208248092}, {4.632889690506627, 1.0959836253056743,
1.0959817050980738}, {4.633748366417633, 1.0996015331220048,
1.0971626432790218}, {1.7821782258644072, 1.782178213053708,
1.7821782056997435}, {1.7821782622464275, 1.7821781764107172,
1.7821781718676413}, {4.634563055776168, 1.0995031878511892,
1.0988903915925954}, {4.632746492697089, 1.0975933124396806,
1.0971173683833484}, {4.6289921590805445, 1.093693498426831,
1.093558506242173}, {4.628566772191042, 1.093216332892832,
1.0931826790306771}, {4.6295627390486445, 1.093862122711905,
1.0937220515467836}, {4.628484388976073, 1.0931285780202415,
1.0931054586574926}, {4.631687966005123, 1.0981088040442486,
1.0945316912309686}, {4.634659639818005, 1.102861367265082,
1.0941896180180226}, {4.630986996972632, 1.0976195839502099,
1.0936203359565297}, {4.633886353529327, 1.0987969596238771,
1.0982439889789972}, {4.626854116741907, 1.0915205867789937,
1.0914561287134772}, {4.631579419473298, 1.0964131431992172,
1.096012759191009}, {4.63300410994884, 1.0993298751859482,
1.0959448855222167}, {4.634665229125501, 1.0993124890086887,
1.0992856766088182}, {4.6316675334667785, 1.0991172713466837,
1.0967786484022302}, {4.633024264409726, 1.0976822496790661,
1.0975824300326498}, {4.6103206892361825, 1.0722185419416488,
1.0655683869514032}, {4.619138406225702, 1.089874272371105,
1.0776522988896653}, {4.633253807856525, 1.0992643110098186,
1.0948888568188795}, {4.634587401632189, 1.1007410828610376,
1.0976981625199784}, {4.630549847946725, 1.0956511288417514,
1.0947161132035614}, {4.6338761030110405, 1.0985188725008304,
1.098499636881484}, {4.62647358589989, 1.091203765090824,
1.0910124861588886}, {4.633606619785303, 1.0983652466123346,
1.0980204628746342}, {4.63003015660613, 1.094894235026198,
1.0944318048050408}, {1.7821782665598649, 1.7821781910613592,
1.7821781458443935}, {1.782178262555449, 1.7821782115531855,
1.7821781281225377}, {4.633878705367475, 1.0987733497370047,
1.098250192548254}, {4.634111858237305, 1.0990442063497432,
1.0984478129803492}, {4.628879612069581, 1.0935157658501131,
1.0935122142528435}, {4.629931558657129, 1.094615983482181,
1.094513350724808}, {4.628780111064041, 1.0934563082740338,
1.0933691855477623}, {4.633090708056657, 1.0979082616536864,
1.0975419163852478}, {4.633462986477512, 1.104524343003987,
1.091597284512775}, {4.628903205161724, 1.109486648788766,
1.0774592939914904}, {4.6330980858689195, 1.0979635232925447,
1.0974981913062274}, {4.6204607209485875, 1.108232773926825,
1.0600789919540927}, {4.62990425209302, 1.094538807792192,
1.0945352613293138}, {4.630930702558078, 1.0955817609067156,
1.09554653364904}, {4.629678666879561, 1.09437091868271,
1.094255057105462}, {4.627969195184841, 1.0926419971885992,
1.0925649298605031}, {4.633882911429514, 1.1004706133906128,
1.0961376872121722}, {4.610136004816116, 1.0758456151691589,
1.0662408450336203}, {1.7821782426455937, 1.7821782401419397,
1.7821782375015325}, {4.6339246596020365, 1.1025497494617507,
1.0945596302801377}, {4.631343908337303, 1.09519015974554,
1.0951863886076638}, {4.63182102998238, 1.09605706223029,
1.0960440015739492}, {4.629898252957912, 1.0945692425507279,
1.0944935207279352}, {4.630253809169652, 1.0957021864743024,
1.0956692010308122}, {4.634215841103628, 1.0989181624347608,
1.0987812653262299}, {4.629254578264443, 1.095839661013931,
1.0919355531118964}, {4.633899238572557, 1.1024902979830358,
1.094569063179371}, {1.7821782156518977, 1.7821782075738928,
1.7821782069058023}, {4.630998538365859, 1.095634064809003,
1.09563031143123}, {4.631606559140232, 1.0962631537168928,
1.0962186968676015}, {4.630883395500399, 1.0956862064460648,
1.0955470245026304}, {4.631155056489257, 1.0960407027128076,
1.0959461846919822}, {4.63464361875729, 1.0995610241914973,
1.0990454869857198}, {4.627769338691886, 1.0995350826784915,
1.0991359329884394}, {4.632311180052006, 1.101956615177343,
1.0919215762818375}, {1.7821782187421231, 1.7821782170363305,
1.78217821679206}, {4.636442936858322, 1.1005782415087286,
1.0952089619070715}, {4.632912186334626, 1.1076301678898268,
1.0869886280431216}, {1.7821782530421315, 1.7821782134749404,
1.782178138791525}, {4.625809233693003, 1.0904755549048777,
1.0904102179403978}, {4.631242478056988, 1.0960148542230328,
1.0957370954960894}, {4.626743018852252, 1.0914221728041034,
1.0913318905153555}, {4.629842318051541, 1.0945367126492624,
1.0944156018235482}, {4.630628716997203, 1.09532979288445,
1.0951964332422914}, {1.7821782560829351, 1.782178182350041,
1.7821781676419366}, {1.7821782654476221, 1.7821781824688236,
1.7821781347476844}, {4.632227349478559, 1.104727515221102,
1.0889620929179047}, {4.629859641853101, 1.096104769343091,
1.0928795107662506}, {4.633720612182211, 1.0985241804219381,
1.0980798262437301}, {4.633902741071321, 1.0987061392069732,
1.0983676859125169}, {4.628642585480639, 1.0933049679935847,
1.0932461715001067}, {4.629793630644775, 1.0944560311703375,
1.094399533089984}, {1.7821782224231548, 1.7821782156826125,
1.7821782099317534}, {4.632930247698989, 1.107013147881394,
1.0878676666309512}, {1.782178218917672, 1.7821782183946724,
1.7821782183835977}, {4.632045129705727, 1.097482137749623,
1.0966870079349649}, {4.633878820337265, 1.1004114953497883,
1.096609526352466}, {4.625519131206819, 1.0902808833820963,
1.0900233521607257}, {4.629601133885636, 1.0942965094177077,
1.0941734472750821}, {4.631343837939016, 1.0960086651853445,
1.0959448480765503}, {4.633480505178389, 1.1027431385560358,
1.0918619122451034}, {4.626009473558213, 1.1107657846739325,
1.0699175324887884}, {1.7821782297366828, 1.7821782293999358,
1.7821782285594006}, {4.626738785159658, 1.0914076418625709,
1.0913352107350245}, {4.633692345091232, 1.0983942746671815,
1.0982590222946043}, {4.633769336942441, 1.0978487487674213,
1.097362331542783}, {4.626099642203344, 1.0907544195721688,
1.0907134628460198}, {4.629923721128267, 1.0945852641261846,
1.0945274534532443}, {4.6347198659819, 1.0997070919323404,
1.0989992869491565}, {4.625291636992392, 1.0900774353944462,
1.0897726915254806}, {4.6315156780056, 1.0970629406096133,
1.0953368849516405}, {4.63393630249651, 1.1030166055290416,
1.0941142774457744}, {4.63356462183661, 1.1002290366821137,
1.0961640273187274}, {4.6278333188763305, 1.0926968521382137,
1.0922383244557632}, {4.627390863776004, 1.0920729530001598,
1.0919751701834868}, {4.633744388618624, 1.09868414666879,
1.098283262089589}, {4.633113791408536, 1.0985553895663422,
1.098517901800121}, {4.634393384544145, 1.0992233389163328,
1.0988289785319716}, {4.626591518815212, 1.0913984682803213,
1.091051233312806}, {4.634180146226997, 1.1009684460975018,
1.0966554794753278}, {1.782178244139888, 1.7821782194218463,
1.7821781683450015}, {1.782178217928397, 1.7821782178164949,
1.7821782175000576}, {4.634214196454377, 1.1003124954298034,
1.095828399123256}, {4.633938768723598, 1.1002042673506942,
1.0968438145985924}, {4.6291888256230225, 1.093851808481601,
1.0937913116526203}, {4.633814282170795, 1.098593651417665,
1.0983003432314247}, {4.630526286509474, 1.0954116272523202,
1.0949067524944915}, {4.633667617106059, 1.0993672981737561,
1.0972356898762872}, {4.633841894074934, 1.1008356192420206,
1.0961130726136301}, {1.782178438465777, 1.782178438383918,
1.7821784383770773}, {1.7821780107503244, 1.7821780105545248,
1.7821780105522056}, {4.633230319153905, 1.0989239680661282,
1.0984223864423985}, {4.630540874760529, 1.095223567355211,
1.0951243764170415}, {4.628711693836818, 1.0933712082945442,
1.0933173825349958}, {4.631566944510164, 1.0964109775559194,
1.095990753718179}, {4.633846908941807, 1.0992282182954605,
1.0976293328271305}, {4.629774744358188, 1.094437376363828,
1.094378224912907}, {1.782178238439778, 1.7821782209337977,
1.7821781636560858}, {1.7821782810378486, 1.7821781758050574,
1.7821781197013087}, {4.6256304139952125, 1.0937744666819305,
1.0867486367338954}, {4.631018050878536, 1.095711314533029,
1.0955902958199117}, {4.6297032797206645, 1.0943620634907198,
1.094310127804341}, {4.631705722167048, 1.0964866194616316,
1.0961907608446129}, {4.631540577476475, 1.0961813095383712,
1.096166173824984}, {4.634614969785078, 1.099371310463111,
1.0991271018393725}, {4.620046941895322, 1.1131725575125417,
1.0489318767983717}, {4.6273489000827865, 1.0920106093376472,
1.0919524059740469}, {1.7821783723532392, 1.7821783723388531,
1.7821783722439877}, {4.63132931318714, 1.0960295964212226,
1.0958951735122275}, {4.630638591187705, 1.0953009198223105,
1.0952425202130687}, {4.631671171622347, 1.096406968994134,
1.0962041388821235}, {4.634041538666166, 1.0989640632655948,
1.0983852552672773}, {4.626786879562127, 1.0914572468808377,
1.0913822274583929}, {4.639019084772859, 1.0990920887044595,
1.0962219177868173}, {4.622465386784579, 1.1073275088598613,
1.0667616173868322}, {1.7821782956040764, 1.7821781492337998,
1.7821781289346912}, {1.7821782594901547, 1.78217821620207,
1.7821781237820011}, {4.6334146720795495, 1.1023447888006563,
1.0937431773535282}, {1.7821782184827115, 1.7821782181619652,
1.782178217287757}, {4.632808050980037, 1.1005213586009075,
1.0959778700660983}, {4.631454765268613, 1.0962256499135201,
1.0961587107551167}, {4.634462789037572, 1.0996098967208796,
1.0983714371360511}, {4.634406522059262, 1.099198209168747,
1.0988833456817673}, {4.634482926198381, 1.0989966149307038,
1.0983706429424749}, {1.7821781653890925, 1.7821781653158855,
1.7821781651069306}, {1.7821782210980923, 1.7821782194464595,
1.782178197079796}, {4.630900131088422, 1.1032755673082677,
1.0877633982862662}, {4.6179917850754775, 1.0830208113740156,
1.0806252779492975}, {4.630553147001923, 1.095239979484812,
1.0951315938670876}, {4.632924856347562, 1.0977680845299425,
1.0973499273990555}, {4.627769516042762, 1.092453300557214,
1.0923539079547797}, {4.62990784663922, 1.094602066729353,
1.0944817660301243}, {4.619364588300723, 1.0892668625348958,
1.078714066451085}, {4.624269130802406, 1.0993246357282849,
1.078424564871748}, {1.782178218306192, 1.782178215238749,
1.7821782085563591}, {4.633228883693543, 1.1018536175202365,
1.0938618200521015}, {4.634088862668109, 1.1007050305580237,
1.0967359484029446}, {4.63128952265368, 1.0995497461917003,
1.0990784492582182}, {4.633797254993305, 1.0986267156785452,
1.0982854885910196}, {4.6291490746184865, 1.0938150054135,
1.0937506020627934}, {1.7821782598516867, 1.7821781947568438,
1.7821781520706579}, {4.631522118244263, 1.1051028005434806,
1.0871177444140283}, {4.6177146803702795, 1.0977899029761218,
1.0667855246505262}, {1.782178254783224, 1.7821781869388462,
1.7821781663093057}, {4.627434633070776, 1.0922624319856795,
1.0918743556468273}, {4.632717140975467, 1.098749248142308,
1.0959527127877884}, {4.62776684109561, 1.0925350378877072,
1.0922639652744062}, {4.630495478936828, 1.0952029445723555,
1.0950544615128697}, {4.633540237993966, 1.0988163795669343,
1.0959814596721034}, {4.639794717089401, 1.1001577133552358,
1.0965335758137171}, {4.618667129183747, 1.0914697636148154,
1.0626585163141091}, {1.7821782177777197, 1.7821782177530632,
1.7821782177454037}, {4.628485156819136, 1.1034581077387204,
1.0827271414714743}, {1.7821782278802916, 1.782178217488827,
1.7821781921791753}, {4.6328189459460845, 1.0976302355123888,
1.0972761501959412}, {4.629891889529158, 1.0945317705369217,
1.094518878131033}, {4.632949199013176, 1.0978322044921611,
1.0973349018150802}, {4.634041131289353, 1.0989149145226065,
1.0986290192964505}, {4.633758257256547, 1.0996488670057383,
1.096932551986466}, {4.634269605539588, 1.1032729059160655,
1.0944730797786553}, {4.6298148454716355, 1.0946679565720523,
1.0942297811291546}, {4.634105299339605, 1.0999309930998626,
1.097547337197966}, {4.632978164086134, 1.0976135763452626,
1.0976103876151617}, {4.628352535998441, 1.093008980537016,
1.0929611774665182}, {4.627543349800665, 1.0923261253648884,
1.0920291550289019}, {4.631004400572808, 1.097501383127232,
1.0971314274238486}, {4.627848667464798, 1.0996417177879376,
1.099051569643019}, {4.632747178279302, 1.0987487853356863,
1.0960133177159899}, {1.7821782772870258, 1.7821781727302521,
1.78217814603835}, {1.7821782591781807, 1.7821781986276788,
1.7821781342985743}, {1.7821782292513486, 1.782178209960088,
1.7821782005052107}, {4.633379891862798, 1.1002277159750984,
1.0957452490694857}, {4.634220601656808, 1.1001596088651748,
1.098351795735992}, {4.6279972186905685, 1.092679954655677,
1.0925806233913598}, {4.633904019599938, 1.098789775183122,
1.098287034301549}, {4.635624513359043, 1.0990051448475928,
1.0983559171595014}, {4.625680244024465, 1.0904521517212464,
1.090174269340893}, {4.631431812899657, 1.1048346229343478,
1.0841400658582978}, {1.78217821136866, 1.782178210616978,
1.7821782071885972}, {4.632634854006185, 1.1002144208164677,
1.0959999807561733}, {4.625870487461109, 1.0906981831736537,
1.090308541205196}, {4.62984640924288, 1.0945391685826418,
1.0944191951011126}, {4.628661797582045, 1.0933419418133776,
1.0932487064125536}, {4.6339237755284985, 1.0987715514896998,
1.0983425793316204}, {4.627162319798182, 1.0931121331337892,
1.0904793979731253}, {4.629723376110292, 1.0957553368218975,
1.0929567758801673}, {1.782178210899426, 1.782178210753537,
1.78217821072719}, {4.632915375204023, 1.1039125964643002,
1.0919587571950926}, {4.632916161496431, 1.0980668745734246,
1.0970342761187224}, {4.630656692202246, 1.0953573868124657,
1.095221721006586}, {4.6298684882261325, 1.0945498638367779,
1.094453221744989}, {4.633420493902133, 1.0987424198505593,
1.098115857149877}, {4.632647850247808, 1.0977684134619097,
1.0967942473217422}, {4.628964891887905, 1.0937916322005776,
1.093406991615828}, {4.633956766495952, 1.098849483687892,
1.098329810431893}, {1.7821782657916128, 1.782178182563235,
1.7821781351169887}, {4.631752709518959, 1.0974384186951538,
1.0953328414826287}, {4.629100018056158, 1.109735335556899,
1.0776020488399833}, {1.7821782406783102, 1.7821782197467901,
1.7821781576231295}, {1.7821782142229652, 1.7821782134084538,
1.7821782131318817}, {4.6347259226908095, 1.099551036963113,
1.0987973177176564}};


I wish to eliminate duplicates here, however I have difficulty of finding the proper criterion

after applying DeleteDuplicates[Floor[list, 0.001]] I reduce the number of elements in the list to 91

{{1.782, 1.782, 1.782}, {4.632, 1.106, 1.087}, {4.627, 1.106,
1.077}, {4.631, 1.096, 1.096}, {4.632, 1.097, 1.096}, {4.627, 1.092,
1.092}, {4.629, 1.094, 1.094}, {4.63, 1.095, 1.095}, {4.634, 1.099,
1.098}, {4.634, 1.101, 1.096}, {4.633, 1.099, 1.097}, {4.631,
1.095, 1.095}, {4.632, 1.095, 1.095}, {4.632, 1.097, 1.097}, {4.628,
1.093, 1.093}, {4.629, 1.093, 1.093}, {4.631, 1.098,
1.094}, {4.634, 1.102, 1.094}, {4.63, 1.097, 1.093}, {4.633, 1.098,
1.098}, {4.626, 1.091, 1.091}, {4.633, 1.099, 1.095}, {4.634, 1.099,
1.099}, {4.631, 1.099, 1.096}, {4.633, 1.097, 1.097}, {4.61, 1.072,
1.065}, {4.619, 1.089, 1.077}, {4.633, 1.099, 1.094}, {4.634, 1.1,
1.097}, {4.63, 1.095, 1.094}, {4.63, 1.094, 1.094}, {4.633, 1.104,
1.091}, {4.628, 1.109, 1.077}, {4.62, 1.108, 1.06}, {4.633, 1.1,
1.096}, {4.61, 1.075, 1.066}, {4.633, 1.102, 1.094}, {4.634, 1.098,
1.098}, {4.629, 1.095, 1.091}, {4.631, 1.096, 1.095}, {4.627, 1.099,
1.099}, {4.632, 1.101, 1.091}, {4.636, 1.1, 1.095}, {4.632, 1.107,
1.086}, {4.625, 1.09, 1.09}, {4.632, 1.104, 1.088}, {4.629, 1.096,
1.092}, {4.632, 1.107, 1.087}, {4.633, 1.102, 1.091}, {4.626, 1.11,
1.069}, {4.626, 1.09, 1.09}, {4.625, 1.09, 1.089}, {4.631, 1.097,
1.095}, {4.633, 1.103, 1.094}, {4.627, 1.092, 1.091}, {4.634, 1.1,
1.096}, {4.634, 1.1, 1.095}, {4.625, 1.093, 1.086}, {4.62, 1.113,
1.048}, {4.639, 1.099, 1.096}, {4.622, 1.107, 1.066}, {4.633, 1.102,
1.093}, {4.632, 1.1, 1.095}, {4.63, 1.103, 1.087}, {4.617, 1.083,
1.08}, {4.619, 1.089, 1.078}, {4.624, 1.099, 1.078}, {4.633, 1.101,
1.093}, {4.631, 1.099, 1.099}, {4.631, 1.105, 1.087}, {4.617, 1.097,
1.066}, {4.632, 1.098, 1.095}, {4.633, 1.098, 1.095}, {4.639, 1.1,
1.096}, {4.618, 1.091, 1.062}, {4.628, 1.103, 1.082}, {4.633, 1.099,
1.096}, {4.634, 1.103, 1.094}, {4.634, 1.099, 1.097}, {4.628,
1.093, 1.092}, {4.631, 1.097, 1.097}, {4.632, 1.098, 1.096}, {4.633,
1.1, 1.095}, {4.634, 1.1, 1.098}, {4.635, 1.099, 1.098}, {4.631,
1.104, 1.084}, {4.627, 1.093, 1.09}, {4.629, 1.095, 1.092}, {4.632,
1.103, 1.091}, {4.632, 1.098, 1.097}, {4.629, 1.109, 1.077}}


however, many of the elements in the list are still considered (by me) as duplicates, for example:

the elements {4.631, 1.099, 1.099}, {4.632, 1.098, 1.097},{4.634, 1.1, 1.098} are duplicates. at total I expect the length of the list after removing all the duplicates to be no longer than 10.

What criterion should I apply to eliminate these duplicates? A metric distance for example can be useful, how can it be applied?

• DeleteDuplicates[list, EuclideanDistance[##] < .01 &]?
– ciao
Commented May 2, 2021 at 6:23
• @ciao, it helps a lot Commented May 2, 2021 at 6:37

The problem of clustering is much more difficult than what DeleteDuplicates can deal with. Graph clustering methods are required here, lest you fall into edge cases when the clusters aren't well separated.

FindClusters with default settings only finds two major clusters. We can compute their means and covariances with

{Mean[#], Covariance[#]} & /@ FindClusters[list]
(*    {{{1.78218, 1.78218, 1.78218},
{{3.43653*10^-15, 2.67606*10^-15, 2.26368*10^-15},
{2.67606*10^-15, 3.42421*10^-15, 3.58434*10^-15},
{2.26368*10^-15, 3.58434*10^-15, 4.77886*10^-15}}},
{{4.63073, 1.09729, 1.09322},
{{0.000016663, 0.0000109568, 0.0000239168},
{0.0000109568, 0.0000240003, -2.33322*10^-7},
{0.0000239168, -2.33322*10^-7, 0.0000554542}}}}        *)


We can also find three clusters, depending on taste:

Mean /@ FindClusters[list, 10]
(*    {{1.78218, 1.78218, 1.78218},
{4.63136, 1.09757, 1.0944},
{4.61709, 1.09121, 1.06747}}    *)


If you want even more fine-grained clusters, you can do several iterations of FindClusters, starting with FindClusters /@ FindClusters[list]` etc.