On 07/29/2013 10:27 PM, Gabe Schwartz wrote:
> C = (A[..., np.newaxis, np.newaxis] == B)
> rows = (C.sum(axis=(1,2,3)) >= B.shape[1]).nonzero()[0]
Hello,
thank you, it's not fast but really nice.
Nicola
--
_
Nicola Creati
Istitu
Nicola Creati inogs.it> writes:
>
> I need to search rows of A that contain elements of each row of B
> regardless of the order of the elements in B.
>
I don't know how fast this is, but it is fairly short:
C = (A[..., np.newaxis, np.newaxis] == B)
rows = (C.sum(axis=(1,2,3)) >= B.shape[1]).
Hello,
I'm wondering if there is a fast way to solve the following problem. I
have two arrays:
A = [[ 4, 9, 10],
[ 7, 4, 17],
[12, 21, 14],
[12, 24, 11],
[18, 21, 3],
[16, 3, 7],
[17, 21, 5],
[24, 3, 14]]
B = [[17, 5],
[14,
Hi Pauli,
Thanks for looking into this. Apologies for mangling the email subject line in
my previous reply.
Answers are below, inline:
> That is interesting, as it has worked for me on all configurations.
> You can check under 'build/testenv/' --- does your Python version by
> chance install