Re: [Numpy-discussion] Slicing, sum, etc. reduces rank of array?

2010-09-24 Thread josef . pktd
On Fri, Sep 24, 2010 at 10:23 PM, Benjamin Root wrote: > On Fri, Sep 24, 2010 at 8:56 PM, George wrote: >> >> I couldn't find an answer to my newbie question, so I'm posting it here. >> >> I have: >> >> a=numpy.array([[1,2],[3,4]]) >> b=numpy.array([[5,6],[7,8]]) >> >> Via broadcasting, I know th

Re: [Numpy-discussion] Slicing, sum, etc. reduces rank of array?

2010-09-24 Thread Benjamin Root
On Fri, Sep 24, 2010 at 8:56 PM, George wrote: > I couldn't find an answer to my newbie question, so I'm posting it here. > > I have: > > a=numpy.array([[1,2],[3,4]]) > b=numpy.array([[5,6],[7,8]]) > > Via broadcasting, I know that > a*[[5],[7]]=numpy.array([[5,10],[21,28]]) > > Being a recent co

[Numpy-discussion] Slicing, sum, etc. reduces rank of array?

2010-09-24 Thread George
I couldn't find an answer to my newbie question, so I'm posting it here. I have: a=numpy.array([[1,2],[3,4]]) b=numpy.array([[5,6],[7,8]]) Via broadcasting, I know that a*[[5],[7]]=numpy.array([[5,10],[21,28]]) Being a recent convert from MATLAB, I expected the same result from a*b[:,0], assum

Re: [Numpy-discussion] [PATCH] F2Py on Python 3

2010-09-24 Thread Lisandro Dalcin
On 23 September 2010 23:34, Charles R Harris wrote: > > > On Thu, Sep 23, 2010 at 7:22 PM, Lisandro Dalcin wrote: >> >> On 23 September 2010 01:26, Charles R Harris >> wrote: >> > >> > >> > On Wed, Sep 22, 2010 at 10:00 PM, Charles R Harris >> > wrote: >> >> >> >> >> >> On Wed, Sep 22, 2010 at

Re: [Numpy-discussion] constructing an array from memory

2010-09-24 Thread Robert Kern
On Fri, Sep 24, 2010 at 11:25, Mathew Yeates wrote: > I'm trying to do something ... unusual. > > gdb support scripting with Python. From within my python script, I can > get the address of a contiguous area of memory that stores a  fortran > array. I want to creat a NumPy array using "frombuffer"

Re: [Numpy-discussion] constructing an array from memory

2010-09-24 Thread Mathew Yeates
Thank a lot. I was wading through the Python C API. This is much simpler. -Mathew On Fri, Sep 24, 2010 at 10:21 AM, Zachary Pincus wrote: >> I'm trying to do something ... unusual. >> >> gdb support scripting with Python. From within my python script, I can >> get the address of a contiguous are

Re: [Numpy-discussion] constructing an array from memory

2010-09-24 Thread Zachary Pincus
> I'm trying to do something ... unusual. > > gdb support scripting with Python. From within my python script, I can > get the address of a contiguous area of memory that stores a fortran > array. I want to creat a NumPy array using "frombuffer". I see that > the CPython API supports the creation

[Numpy-discussion] constructing an array from memory

2010-09-24 Thread Mathew Yeates
I'm trying to do something ... unusual. gdb support scripting with Python. From within my python script, I can get the address of a contiguous area of memory that stores a fortran array. I want to creat a NumPy array using "frombuffer". I see that the CPython API supports the creation of a buffer

[Numpy-discussion] F2py and Absoft Fortran compiler v11.0 (unable to locate U77.lib) [patch]

2010-09-24 Thread Åsmund Hjulstad
Hi all, I have a small patch to absoft.py: Compiling my fortran extension using f2py and distutils from Numpy 1.5, with Python 2.7 on Windows, using Absoft v11.0 and MSVC 2008 Pro, first, it complained about not finding the library U77.lib. Removing this from the library list (in absoft.py) gave