Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python find equal rows of two numpy arrays

import numpy as np
x = np.array([[0,1],[2,0],[3,0]])
y = np.array([2,0])
Ind = np.where((x == y).all(1))[0][0]
print("Index of y in x:", Ind)
Comment

PREVIOUS NEXT
Code Example
Python :: flatten columns after pivot pandas 
Python :: pandas dataframe sort by column name first 10 values 
Python :: how to use cv2.COLOR_BGR2GRAY 
Python :: tkinter simple notification 
Python :: pandas read excel with two headers 
Python :: django timezone settings 
Python :: try python import 
Python :: python list transpose 
Python :: urllib 
Python :: alpha beta pruning python code 
Python :: seaborn and matplotlib Setting the xlim and ylim python 
Python :: how to have requirement file in python for libs 
Python :: how to use get-pip.py 
Python :: trim starting space python 
Python :: read csv pandas 
Python :: breadth first search graph python 
Python :: python re compile 
Python :: discord.py mention user 
Python :: two dimensional array python 
Python :: string to array python 
Python :: Calculate Euclidean Distance in Python 
Python :: python zip folder 
Python :: how to change case of string in python 
Python :: python venv activate 
Python :: python random randint string 
Python :: matplotlib bar chart 
Python :: python multiplication array 
Python :: swap variables in python 
Python :: python align label left 
Python :: match python 3.10 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =