On Sat, Nov 24, 2012 at 7:08 PM, David Warde-Farley <
d.warde.far...@gmail.com> wrote:
> I think that would lose information as to which value in B was at each
> position. I think you want:
>
>
(premature send, stupid Gmail...)
idx = {}
for i, x in enumerate(a):
for j, y in enumerate(x):
I think that would lose information as to which value in B was at each
position. I think you want:
On Sat, Nov 24, 2012 at 5:23 PM, Daπid wrote:
> A pure Python approach could be:
>
> for i, x in enumerate(a):
> for j, y in enumerate(x):
> if y in b:
>
On Sat, Nov 24, 2012 at 1:30 PM, Gamblin, Todd wrote:
> So, just FYI, my usage of this is for Rubik, where it's a communication
> latency optimization for the code being mapped to the network. I haven't
> tested it as an optimization for particular in-core algorithms. However,
> there was some
A pure Python approach could be:
for i, x in enumerate(a):
for j, y in enumerate(x):
if y in b:
idx.append((i,j))
Of course, it is slow if the arrays are large, but it is very
readable, and probably very fast if cythonised.
David.
On Sat, Nov 24,
M = A[..., np.newaxis] == B
will give you a 40x60x20 boolean 3d-array where M[..., i] gives you a
boolean mask for all the occurrences of B[i] in A.
If you wanted all the (i, j) pairs for each value in B, you could do
something like
import numpy as np
from itertools import izip, groupby
from ope
> Message: 6
> Date: Sat, 24 Nov 2012 20:36:45 +
> From: Siegfried Gonzi
> Subject: [Numpy-discussion] numpy where function on different size
> Hi all
>This must have been answered in the past but my google search
> capabilities are not the best.
>Given an array A say of dimension 40x60 and g
Hi all
This must have been answered in the past but my google search capabilities are
not the best.
Given an array A say of dimension 40x60 and given another array/vector B of
dimension 20 (the values in B occur only once).
What I would like to do is the following which of course does not w
So, just FYI, my usage of this is for Rubik, where it's a communication latency
optimization for the code being mapped to the network. I haven't tested it as
an optimization for particular in-core algorithms. However, there was some
work on this at LLNL maybe a couple years ago -- I think it w
Todd,
I am optimistic and I think it would be a good idea to put this in. A
couple previous studies [1] haven't found any useful speedups from in-core
applications for Morton-order, and if you have results for real scientific
applications using numpy this would not only be great, but the resultin
This is pretty cool.Something like this would be interesting to play with.
There are some algorithms that are faster with z-order arrays.The code is
simple enough and small enough that I could see putting it in NumPy. What do
others think?
-Travis
On Nov 24, 2012, at 1:03 PM, Gamb
Hi all,
In the course of developing a network mapping tool I'm working on, I also
developed some python code to do arbitrary-dimensional z-order (morton order)
for ndarrays. The code is here:
https://github.com/tgamblin/rubik/blob/master/rubik/zorder.py
There is a function to put the
Hi all,
I posted on the change in semantics of ndarray.base here:
https://github.com/numpy/numpy/commit/6c0ad59#commitcomment-2153047
And some folks asked me to post my question to the numpy mailing list. I've
implemented a tool for mapping processes in parallel applications to nodes i
12 matches
Mail list logo