Linked Questions

1 vote
1 answer
892 views

I have two 2d numpy arrays and want to find where one array is occuring in another one: big_array = np.array([[1., 2., 1.2], [5., 3., 0.12], [-1., 14., 0.], [-9., 0., 13.]]) small_array= np.array([[5.,...
Link_tester's user avatar
  • 1,081
4 votes
2 answers
11k views

I am trying to create an API which takes an image URL as input and returns back a color palette in JSON format as output. It should work something like this: http://lokeshdhakar.com/projects/color-...
Jyotiska's user avatar
  • 255
3 votes
2 answers
4k views

Suppose I have a numpy array of arrays of length 4: In [41]: arr Out[41]: array([[ 1, 15, 0, 0], [ 30, 10, 0, 0], [ 30, 20, 0, 0], ..., [104, 139, 146, 75]...
petRUShka's user avatar
  • 10.2k
0 votes
3 answers
1k views

System OS: Windows 10 (x64), Build 1909 Python Version: 3.8.10 Numpy Version: 1.21.2 Question Given two 2D (N, 3) Numpy arrays of (x, y, z) floating-point data points, what is the Pythonic (vectorized)...
adam.hendry's user avatar
  • 5,873
2 votes
2 answers
618 views

Suppose you have two 2D arrays A and B, and you want to check, where a row of A is contained in B. How do you do this most efficiently using numpy? E.g. a = np.array([[1,2,3], [4,5,6],...
0vbb's user avatar
  • 903
0 votes
2 answers
716 views

I'm working on a project where my original dataframe is: A B C label 0 1 2 2 Nan 1 2 4 5 7 2 3 6 5 Nan 3 4 8 7 Nan 4 5 ...
Sarah De Cock's user avatar
0 votes
2 answers
334 views

In other words, I need to define the index correspondence between equal unique numbers inside two unsorted 2d arrays. Similar questions: how to find indices of a 2d numpy array occuring in another 2d ...
Yerbol Sapar's user avatar
1 vote
3 answers
108 views

I have two large data files, one with two columns and one with three columns. I want to select all the rows from the second file that are contained in the fist array. My idea was to compare the numpy ...
Ernie's user avatar
  • 59
1 vote
2 answers
103 views

I want to filter out elements of a 2d list from another 2d list c = (array([1, 1, 1, 1]), array([2, 3, 4, 5])) b = [[1 1 1 1] [2 3 4 5] [2 3 4 1] [4 5 6 7]] a = itertools.filterfalse(lambda x: x ...
june210's user avatar
  • 35
0 votes
1 answer
25 views

I've got an ndarray myndarray and a set myset. I can do this: myndarray[myndarray[:,:,-1] == some_value] = 0 But this returns "unhashable type: 'numpy.ndarray'" myndarray[myndarray[:,:,-1] ...
user3673's user avatar
  • 715