it's tested
Cons:
- the implementation is not super efficient. Temporary copies are created.
However, bmat also does that.
Feedback is very welcome!
Best,
Stefan
On Sun, May 10, 2015 at 12:33 PM, Stefan Otte wrote:
> Hey,
>
> Just a quick update. I updated the pull request and rena
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:
ández del Río <
jaime.f...@gmail.com> wrote:
> 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
>
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
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
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(
at 2:13 PM Stefan Otte wrote:
> To make the last point more concrete the implementation could look
> something like this (note that I didn't test it and that it still
> takes some work):
>
>
> def bmat(obj, ldict=None, gdict=None):
> return matrix(stack(obj, ldict, gdi
Hey,
> 1. np.stack for stacking like np.asarray(np.bmat(...))
> http://thread.gmane.org/gmane.comp.python.numeric.general/58748/
> https://github.com/numpy/numpy/pull/5057
I'm the author of this proposal. I'll just give some context real quickly.
"My stack" started really simple, basically allow
Hey *,
The websites to subscribe to the numpy/scipy mailinglists seem to be down:
- http://mail.scipy.org/mailman/listinfo/scipy-user
- http://mail.scipy.org/mailman/listinfo/scipy-user
- http://projects.scipy.org/pipermail/scipy-dev/
And it's not just me:
http://www.downforeveryoneorjustme.com
else:
arr_rows.append(concatenate(row, axis=-1))
return concatenate(arr_rows, axis=0)
if isinstance(obj, N.ndarray):
return obj
I basically turned the old `bmat` into `stack` and removed the matrix calls.
Best,
Stefan
On Wed, Oct 29, 2014 at 3:59 PM, Stefan
and the feature to
specify a string representation of the block matrix is nice.
Best,
Stefan
On Tue, Oct 28, 2014 at 7:46 PM, Nathaniel Smith wrote:
> On 28 Oct 2014 18:34, "Stefan Otte" wrote:
>>
>> Hey,
>>
>> In the last weeks I tested `np.asarray(np.bmat
ested calls to a stacking function.
>>>
>>> However, some form of nd-stack function would be neat in my opinion.
>>>
>>> On Mon, Sep 8, 2014 at 6:10 PM, Jaime Fernández del Río
>>> wrote:
>>>>
>>>> On Mon, Sep 8, 2014 at 7:41 AM, Sturla
r implementing `stack`? More code leads to more
bugs and maintenance work.
Best,
Stefan
On Tue, Sep 9, 2014 at 12:14 AM, cjw wrote:
>
> On 08-Sep-14 4:40 PM, Joseph Martinot-Lagarde wrote:
>> Le 08/09/2014 15:29, Stefan Otte a écrit :
>>> Hey,
>>>
>>&
Hey,
quite often I work with block matrices. Matlab offers the convenient notation
[ a b; c d ]
to stack matrices. The numpy equivalent is kinda clumsy:
vstack([hstack([a,b]), hstack([c,d])])
I wrote the little function `stack` that does exactly that:
stack([[a, b], [c, d]])
In my ca
nd
print out a numpy expression. It's kinda handy but do we actually need
it?
Beste Grüße,
Stefan
On Thu, Feb 20, 2014 at 8:39 PM, Nathaniel Smith wrote:
> On Thu, Feb 20, 2014 at 1:35 PM, Stefan Otte wrote:
>> Hey guys,
>>
>> I quickly hacked together a prototype o
lco Hoogendoorn
>> wrote:
>>>
>>> If the standard semantics are not affected, and the most common
>>> two-argument scenario does not take more than a single if-statement
>>> overhead, I don't see why it couldn't be a replacement for the existing
>&
Hey,
so I propose the following. I'll implement a new function `mdot`.
Incorporating the changes in `dot` are unlikely. Later, one can still include
the features in `dot` if desired.
`mdot` will have a default parameter `optimize`. If `optimize==True` the
reordering of the multiplication is don
Mon, Feb 17, 2014 at 4:57 PM, wrote:
>> On Mon, Feb 17, 2014 at 4:39 PM, Stefan Otte wrote:
>>> Hey guys,
>>>
>>> I wrote myself a little helper function `mdot` which chains np.dot for
>>> multiple arrays. So I can write
>>>
>>> m
Hey guys,
I wrote myself a little helper function `mdot` which chains np.dot for
multiple arrays. So I can write
mdot(A, B, C, D, E)
instead of these
A.dot(B).dot(C).dot(D).dot(E)
np.dot(np.dot(np.dot(np.dot(A, B), C), D), E)
I know you can use `numpy.matrix` to get nicer formulas.
19 matches
Mail list logo