Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6825861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:04:51+00:00 2026-05-26T22:04:51+00:00

I have two lists in Mathematica: list1 = {{a1, b1, c1}, … , {an,

  • 0

I have two lists in Mathematica:

list1 = {{a1, b1, c1}, ... , {an, bn, cn}} 

and

list2 = {{d1, e1, f1}, ... , {dn, en, fn}}

the lists contain numerical results and are roughly consisting of 50000 triplets each. Each triplet represents two coordinates and a numerical value of some property at these coordinates. Each list has different length and the coordinates are not quite the same range. My intention is to correlate the numerical values of the third property from each list so I need to scan through the lists and identify the properties whose coordinates are matching. My output will be something like

list3 = {{ci, fj}, ... , {cl, fm}}

where

{ai, bi}, ..., {al, bl}

will be (roughly) equal to, respectively

{dj, ej}, ..., {dm, em}

By “roughly” I mean the coordinates will match once rounded to some desired accuracy:

list1(2) = Round[{#[[1]], #[[2]], #[[3]]}, {1000, 500, 0.1}] & /@ list1(2)

so after this process I’s have two lists that contain some matching coordinates amongst them. My question is how to perform the operation of identifying them and picking out the pairs of properties in the optimal way?

An example of a 6 element list would be

list1 = {{-1.16371*10^6, 548315., 14903.}, {-1.16371*10^6, 548322., 14903.9}, 
   {-1.16371*10^6, 548330., 14904.2}, {-1.16371*10^6, 548337., 14904.8}, 
   {-1.16371*10^6, 548345., 14905.5}, {-1.16371*10^6, 548352., 14911.5}}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:04:52+00:00Added an answer on May 26, 2026 at 10:04 pm

    You may want to use something like this:

    {Round[{#, #2}], #3} & @@@ Join[list1, list2];
    
    % ~GatherBy~ First ~Select~ (Length@# > 1 &)
    

    This will group all data points that having matching coordinates after rounding. You can use a second argument to Round to specify the fraction to round by.

    This assumes that there are not duplicated points within a single list. If there are, you will need to remove those to get useful pairs. Tell me if this is the case and I will update my answer.

    Here is another method using Sow and Reap. The same caveats apply. Both of these examples are simply guidelines for how you may implement your functionality.

    Reap[
      Sow[#3, {Round[{#, #2}]}] & @@@ Join[list1, list2],
      _,
      List
    ][[2]] ~Cases~ {_, {_, __}}
    

    To deal with duplicate-after-round elements within each list, you may use Round and GatherBy on each list as follows.

    newList1 = GatherBy[{Round[{#, #2}], #3} & @@@ list1, First][[All, 1]];
    
    newList2 = GatherBy[{Round[{#, #2}], #3} & @@@ list2, First][[All, 1]];
    

    and then proceed with:

    newList1 ~Join~ newList2 ~GatherBy~ First ~Select~ (Length@# > 1 &)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two lists (list1 and list2) containing references to some objects, where some
I have two lists of objects. Each list is already sorted by a property
I have two lists, each on different tabs (sub-sites) of the site. I would
Absolute beginner question here. I have two lists in mathematica. The first one was
I have two lists, I want to sum each element in list A with
I have two lists, the first of which is guaranteed to contain exactly one
We have two lists: a=['1','2','3','4'] b=['2','3','4','5'] How to get a list with elements that
I have two lists which are guaranteed to be the same length. I want
i have two lists: List<comparerobj> list_c = new List<comparerobj>(); List<comparerobj> list_b = new List<comparerobj>();
I have two lists: listA: [[Name: mr good, note: good,rating:9], [Name: mr bad, note:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.