Python Forum
Partial "visual" Matching of matrices
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Partial "visual" Matching of matrices
#9
(Nov-01-2019, 10:22 AM)masteripper Wrote: Suppose you have 3 matrices :
A =
1 0 1 1 1 0 0 1
1 0 0 1 1 0 0 1
1 0 1 0 0 0 0 0
1 0 0 0 1 0 0 1

B =
0 1 0 0 1 0 0 1
1 1 0 0 0 0 0 1
1 1 1 0 0 0 0 1
1 0 1 0 1 0 0 1

C =
1 0 1 0 1 0 0 1
1 0 1 1 1 0 0 1
1 0 1 0 0 0 0 1
1 1 0 0 1 0 0 1

[ ... ] in this case Matrix A is more matching to Matrix C in comparison to B.

Hi!

My approach would be comparing matrix A and matrix B, element by element, and keep the number of elements in common in a variable, named, let's say commonElementsAB.

Then, I would do the same, comparing matrix A and matrix C, element by element, and keep the number of elements in common in a variable, named, let's say commonElementsAC.

After that, I would compare the value of commonElementsAB with the value of commonElementsAC. If the value of commonElementsAB is greater than the value of commonElementsAC, that means that Matrix A is more matching to Matrix B than to Matrix C. If the value of commonElementsAC is greater than the value of commonElementsAB, that means that Matrix A is more matching to Matrix C than to Matrix B.

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
RE: Partial "visual" Matching of matrices - by newbieAuggie2019 - Nov-01-2019, 08:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  partial functions before knowing the values mikisDeWitte 4 738 Dec-24-2023, 10:00 AM
Last Post: perfringo
  Move Files based on partial Match mohamedsalih12 2 967 Sep-20-2023, 07:38 PM
Last Post: snippsat
  Partial KEY search in dict klatlap 6 1,438 Mar-28-2023, 07:24 AM
Last Post: buran
  remove partial duplicates from csv ledgreve 0 905 Dec-12-2022, 04:21 PM
Last Post: ledgreve
  Webhook, post_data, GPIO partial changes DigitalID 2 1,113 Nov-10-2022, 09:50 PM
Last Post: deanhystad
  4D matrices ali1almakhmari 0 805 Jun-13-2022, 09:21 AM
Last Post: ali1almakhmari
  Optimal way to search partial correspondence in a large dict genny92c 0 1,057 Apr-22-2022, 10:20 AM
Last Post: genny92c
  Unable to use Pauli Matrices in QNET Package Rupayan 2 1,987 Sep-25-2021, 06:02 AM
Last Post: Rupayan
  Partial Matching Rows In Pandas DataFrame Query eddywinch82 1 2,468 Jul-08-2021, 06:32 PM
Last Post: eddywinch82
  Partial key lookup in dictionary GaryNR 1 3,591 Jul-16-2020, 06:55 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020