Compare elements in 2D two non-identical arrays [on hold]

Multi tool use
up vote
-3
down vote
favorite
I want to compare each elements of List2
with first two elements of List1
and if matched return the 3rd elements from List1
List1 = np.array([[1,9,4],[1,6,2],[1,2,6],[1,7,3],[1,3,6],[1,8,2],[1,5,1],[1,10,2],[1,4]]);
List2 = np.array([[1,2],[1,3],[1,4],[1,5]]);
Expected result:
step-1: compare [1,2]
from List1
with List2
step-2: if matched return the 3rd element of List1
for example 6 from [1,2,6]
any solution is highly appreciated. Thanks
python-3.x
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
put on hold as off-topic by 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe 13 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-3
down vote
favorite
I want to compare each elements of List2
with first two elements of List1
and if matched return the 3rd elements from List1
List1 = np.array([[1,9,4],[1,6,2],[1,2,6],[1,7,3],[1,3,6],[1,8,2],[1,5,1],[1,10,2],[1,4]]);
List2 = np.array([[1,2],[1,3],[1,4],[1,5]]);
Expected result:
step-1: compare [1,2]
from List1
with List2
step-2: if matched return the 3rd element of List1
for example 6 from [1,2,6]
any solution is highly appreciated. Thanks
python-3.x
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
put on hold as off-topic by 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe 13 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.
Welcome to Code Review. Unfortunately your question is off-topic as of now, as the code to be reviewed must be present in the question. Please add the code you want reviewed in your question. Thanks!
– Heslacher
15 hours ago
add a comment |
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
I want to compare each elements of List2
with first two elements of List1
and if matched return the 3rd elements from List1
List1 = np.array([[1,9,4],[1,6,2],[1,2,6],[1,7,3],[1,3,6],[1,8,2],[1,5,1],[1,10,2],[1,4]]);
List2 = np.array([[1,2],[1,3],[1,4],[1,5]]);
Expected result:
step-1: compare [1,2]
from List1
with List2
step-2: if matched return the 3rd element of List1
for example 6 from [1,2,6]
any solution is highly appreciated. Thanks
python-3.x
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I want to compare each elements of List2
with first two elements of List1
and if matched return the 3rd elements from List1
List1 = np.array([[1,9,4],[1,6,2],[1,2,6],[1,7,3],[1,3,6],[1,8,2],[1,5,1],[1,10,2],[1,4]]);
List2 = np.array([[1,2],[1,3],[1,4],[1,5]]);
Expected result:
step-1: compare [1,2]
from List1
with List2
step-2: if matched return the 3rd element of List1
for example 6 from [1,2,6]
any solution is highly appreciated. Thanks
python-3.x
python-3.x
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 15 hours ago
John
1
1
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
John is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
put on hold as off-topic by 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe 13 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as off-topic by 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe 13 hours ago
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Heslacher, πάντα ῥεῖ, Sᴀᴍ Onᴇᴌᴀ, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.
Welcome to Code Review. Unfortunately your question is off-topic as of now, as the code to be reviewed must be present in the question. Please add the code you want reviewed in your question. Thanks!
– Heslacher
15 hours ago
add a comment |
Welcome to Code Review. Unfortunately your question is off-topic as of now, as the code to be reviewed must be present in the question. Please add the code you want reviewed in your question. Thanks!
– Heslacher
15 hours ago
Welcome to Code Review. Unfortunately your question is off-topic as of now, as the code to be reviewed must be present in the question. Please add the code you want reviewed in your question. Thanks!
– Heslacher
15 hours ago
Welcome to Code Review. Unfortunately your question is off-topic as of now, as the code to be reviewed must be present in the question. Please add the code you want reviewed in your question. Thanks!
– Heslacher
15 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
BAbt5ZLdVk
Welcome to Code Review. Unfortunately your question is off-topic as of now, as the code to be reviewed must be present in the question. Please add the code you want reviewed in your question. Thanks!
– Heslacher
15 hours ago