Re: [Numpy-discussion] Optimisation of matrix multiplication

2018-01-29 Thread Andrew Nelson
On 30 January 2018 at 17:22, Andrew Nelson wrote: > Hi all, > I have a matrix multiplication that I'd like to optimize. > > I have a matrix `a` (dtype=complex) with shape (N, M, 2, 2). I'd like to > do the following multiplication: > > a[:, 0] @ a[:, 1] @ ... @ a[:, M-1] > > where the first dimen

[Numpy-discussion] Optimisation of matrix multiplication

2018-01-29 Thread Andrew Nelson
Hi all, I have a matrix multiplication that I'd like to optimize. I have a matrix `a` (dtype=complex) with shape (N, M, 2, 2). I'd like to do the following multiplication: a[:, 0] @ a[:, 1] @ ... @ a[:, M-1] where the first dimension, N, is element wise (and hopefully vectorisable) and M>=2. So

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 10:44 PM, Allan Haldane wrote: > On 01/29/2018 05:59 PM, josef.p...@gmail.com wrote: > >> >> >> On Mon, Jan 29, 2018 at 5:50 PM, > josef.p...@gmail.com>> wrote: >> >> >> >> On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane >> mailto:allanhald...@gmail.com>> wrote: >>

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Allan Haldane
On 01/29/2018 05:59 PM, josef.p...@gmail.com wrote: On Mon, Jan 29, 2018 at 5:50 PM, > wrote: On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane mailto:allanhald...@gmail.com>> wrote: On 01/29/2018 04:02 PM, josef.p...@gmail.com

Re: [Numpy-discussion] f2py bug in numpy v1.12.0 and above?

2018-01-29 Thread Solbrig,Jeremy
I think that I actually may have this solved now. It seems that I can resolve the issue by running "conda install gcc" then linking against the anaconda gfortran libraries rather than my system install. The only problem is that installing gcc through anaconda causes anaconda's version of gcc t

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 5:50 PM, wrote: > > > On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane > wrote: > >> On 01/29/2018 04:02 PM, josef.p...@gmail.com wrote: >> > >> > >> > On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root > > > wrote: >> > >> > I <3 structured arr

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 4:11 PM, Allan Haldane wrote: > On 01/29/2018 04:02 PM, josef.p...@gmail.com wrote: > > > > > > On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root > > wrote: > > > > I <3 structured arrays. I love the fact that I can access data by > > row

Re: [Numpy-discussion] Moving NumPy's PRNG Forward

2018-01-29 Thread Kevin Sheppard
I agree with pretty much everything you wrote Robert. I didn't have quote the right frame but the generic class that takes a low-level core PRNG sounds like the right design, and this should make user-generated distributions easier to develop. I was thinking along these lines inspired by the SpiP

Re: [Numpy-discussion] f2py bug in numpy v1.12.0 and above?

2018-01-29 Thread Matthew Brett
Hi, On Mon, Jan 29, 2018 at 1:02 PM, Andrew Nelson wrote: > Something similar was mentioned at > https://github.com/scipy/scipy/issues/8325. Yes, that one was also for Anaconda... Cheers, Matthew ___ NumPy-Discussion mailing list NumPy-Discussion@pyt

Re: [Numpy-discussion] Moving NumPy's PRNG Forward

2018-01-29 Thread Robert Kern
On Tue, Jan 30, 2018 at 5:39 AM, Pierre de Buyl < pierre.deb...@chem.kuleuven.be> wrote: > > Hello, > > On Sat, Jan 27, 2018 at 09:28:54AM +0900, Robert Kern wrote: > > On Sat, Jan 27, 2018 at 1:14 AM, Kevin Sheppard > > wrote: > > > > > > In terms of what is needed, I think that the underlying PR

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Allan Haldane
On 01/29/2018 04:02 PM, josef.p...@gmail.com wrote: > > > On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root > wrote: > > I <3 structured arrays. I love the fact that I can access data by > row and then by fieldname, or vice versa. There are times when I > n

Re: [Numpy-discussion] f2py bug in numpy v1.12.0 and above?

2018-01-29 Thread Andrew Nelson
Something similar was mentioned at https://github.com/scipy/scipy/issues/8325. ___ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 3:44 PM, Benjamin Root wrote: > I <3 structured arrays. I love the fact that I can access data by row and > then by fieldname, or vice versa. There are times when I need to pass just > a column into a function, and there are times when I need to process things > row by row

Re: [Numpy-discussion] f2py bug in numpy v1.12.0 and above?

2018-01-29 Thread Matthew Brett
Hi, On Mon, Jan 29, 2018 at 10:16 AM, Solbrig,Jeremy wrote: > I have a suite of fortran code that I compile with f2py and use as a plugin > to a python package. I am using Python v2.7 from Anaconda. When compiled > using numpy v1.11.3 or lower, everything works fine, but if I upgrade to any > m

[Numpy-discussion] f2py bug in numpy v1.12.0 and above?

2018-01-29 Thread Solbrig,Jeremy
I have a suite of fortran code that I compile with f2py and use as a plugin to a python package. I am using Python v2.7 from Anaconda. When compiled using numpy v1.11.3 or lower, everything works fine, but if I upgrade to any more recent version I begin running into a runtime error. Presumabl

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Benjamin Root
I <3 structured arrays. I love the fact that I can access data by row and then by fieldname, or vice versa. There are times when I need to pass just a column into a function, and there are times when I need to process things row by row. Yes, pandas is nice if you want the specialized indexing featu

Re: [Numpy-discussion] Moving NumPy's PRNG Forward

2018-01-29 Thread Pierre de Buyl
Hello, On Sat, Jan 27, 2018 at 09:28:54AM +0900, Robert Kern wrote: > On Sat, Jan 27, 2018 at 1:14 AM, Kevin Sheppard > wrote: > > > > In terms of what is needed, I think that the underlying PRNG should > be swappable. The will provide a simple mechanism to allow certain > types of advancement w

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 2:55 PM, Stefan van der Walt wrote: > On Mon, 29 Jan 2018 14:10:56 -0500, josef.p...@gmail.com wrote: > >> Given that there is pandas, xarray, dask and more, numpy could as well >> drop >> any pretense of supporting dataframe_likes. Or, adjust the recfunctions so >> we can

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Stefan van der Walt
On Mon, 29 Jan 2018 14:10:56 -0500, josef.p...@gmail.com wrote: Given that there is pandas, xarray, dask and more, numpy could as well drop any pretense of supporting dataframe_likes. Or, adjust the recfunctions so we can still work dataframe_like with structured dtypes/recarrays/recfunctions.

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread josef . pktd
On Mon, Jan 29, 2018 at 1:22 PM, Eric Wieser wrote: > I think that there's a lot of confusion going around about recarrays vs > structured arrays. > > [`recarray`](https://github.com/numpy/numpy/blob/v1.13.0/ > numpy/core/records.py) are a wrapper around structured arrays that > provide: > * Attr

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Eric Wieser
I think that there's a lot of confusion going around about recarrays vs structured arrays. [`recarray`]( https://github.com/numpy/numpy/blob/v1.13.0/numpy/core/records.py) are a wrapper around structured arrays that provide: * Attribute access to fields as `arr.field` in addition to the normal `ar

Re: [Numpy-discussion] Setting custom dtypes and 1.14

2018-01-29 Thread Chris Barker
On Sat, Jan 27, 2018 at 8:50 PM, Allan Haldane wrote: > On 01/26/2018 06:01 PM, josef.p...@gmail.com wrote: > >> I thought recarrays were pretty cool back in the day, but pandas is >> a much better option. >> >> So I pretty much only use structured arrays for data exchange with C >>