Hey,
I just created a pull request: https://github.com/numpy/numpy/pull/5874
Best,
Stefan
On Tue, May 12, 2015 at 3:29 PM Stefan Otte wrote:
> Hey,
>
> here is an ipython notebook with benchmarks of all implementations (scroll
> to the bottom for plots):
>
> https://github.com/sotte/ipynb_sni
Hey,
here is an ipython notebook with benchmarks of all implementations (scroll
to the bottom for plots):
https://github.com/sotte/ipynb_snippets/blob/master/2015-05%20gridspace%20-%20cartesian.ipynb
Overall, Jaime's version is the fastest.
On Tue, May 12, 2015 at 2:01 PM Jaime Fernández
On Tue, May 12, 2015 at 1:17 AM, Stefan Otte wrote:
> Hello,
>
> indeed I was looking for the cartesian product.
>
> I timed the two stackoverflow answers and the winner is not quite as clear:
>
> n_elements:10 cartesian 0.00427 cartesian2 0.00172
> n_elements: 100 cartesian 0.02758 ca
I'm totally in favor of the 'gridspace(linspaces)' version, as you probably end
up wanting to create grids of other things than linspaces (e.g. a logspace grid,
or a grid of random points etc.).
It should be called somewhat different though. Maybe 'cartesian(arrays)'?
Best,
Johannes
Quoting Stef
Hello,
indeed I was looking for the cartesian product.
I timed the two stackoverflow answers and the winner is not quite as clear:
n_elements:10 cartesian 0.00427 cartesian2 0.00172
n_elements: 100 cartesian 0.02758 cartesian2 0.01044
n_elements: 1000 cartesian 0.97628 cartesian2
On 2015-05-10 14:46:12, Jaime Fernández del Río
wrote:
> Isn't what you are trying to build a cartesian product function?
> There is a neat, efficient implementation of such a function in
> StackOverflow, by our own pv.:
>
> http://stackoverflow.com/questions/1208118/using-numpy-to-build-an-arr
On Sun, May 10, 2015 at 4:40 AM, Stefan Otte wrote:
> Hey,
>
> quite often I want to evaluate a function on a grid in a n-D space.
> What I end up doing (and what I really dislike) looks something like this:
>
> x = np.linspace(0, 5, 20)
> M1, M2 = np.meshgrid(x, x)
> X = np.column_stack([M1
On Sun, May 10, 2015 at 4:40 AM, Stefan Otte wrote:
> Hey,
>
> quite often I want to evaluate a function on a grid in a n-D space.
> What I end up doing (and what I really dislike) looks something like this:
>
> x = np.linspace(0, 5, 20)
> M1, M2 = np.meshgrid(x, x)
> X = np.column_stack([M
On Sun, May 10, 2015 at 7:05 AM, Stefan Otte wrote:
> I just drafted different versions of the `gridspace` function:
>
> https://tmp23.tmpnb.org/user/1waoqQ8PJBJ7/notebooks/2015-05%20gridspace.ipynb
The link seems to be broken...
Jaime
--
(\__/)
( O.o)
( > <) Este es Conejo. Copia a Conejo e
I just drafted different versions of the `gridspace` function:
https://tmp23.tmpnb.org/user/1waoqQ8PJBJ7/notebooks/2015-05%20gridspace.ipynb
Beste Grüße,
Stefan
On Sun, May 10, 2015 at 1:40 PM, Stefan Otte wrote:
> Hey,
>
> quite often I want to evaluate a function on a grid in a n-D space.
Hey,
quite often I want to evaluate a function on a grid in a n-D space.
What I end up doing (and what I really dislike) looks something like this:
x = np.linspace(0, 5, 20)
M1, M2 = np.meshgrid(x, x)
X = np.column_stack([M1.flatten(), M2.flatten()])
X.shape # (400, 2)
fancy_function(
11 matches
Mail list logo