Python Forum
Partial "visual" Matching of matrices
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Partial "visual" Matching of matrices
#10
(Nov-01-2019, 08:33 PM)newbieAuggie2019 Wrote:
(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,
I am thinking that this might be slower...but thanks for replying.
Reply


Messages In This Thread
RE: Partial "visual" Matching of matrices - by masteripper - Nov-01-2019, 09:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  partial functions before knowing the values mikisDeWitte 4 657 Dec-24-2023, 10:00 AM
Last Post: perfringo
  Move Files based on partial Match mohamedsalih12 2 861 Sep-20-2023, 07:38 PM
Last Post: snippsat
  Partial KEY search in dict klatlap 6 1,324 Mar-28-2023, 07:24 AM
Last Post: buran
  remove partial duplicates from csv ledgreve 0 820 Dec-12-2022, 04:21 PM
Last Post: ledgreve
  Webhook, post_data, GPIO partial changes DigitalID 2 1,017 Nov-10-2022, 09:50 PM
Last Post: deanhystad
  4D matrices ali1almakhmari 0 770 Jun-13-2022, 09:21 AM
Last Post: ali1almakhmari
  Optimal way to search partial correspondence in a large dict genny92c 0 1,018 Apr-22-2022, 10:20 AM
Last Post: genny92c
  Unable to use Pauli Matrices in QNET Package Rupayan 2 1,935 Sep-25-2021, 06:02 AM
Last Post: Rupayan
  Partial Matching Rows In Pandas DataFrame Query eddywinch82 1 2,401 Jul-08-2021, 06:32 PM
Last Post: eddywinch82
  Partial key lookup in dictionary GaryNR 1 3,484 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