Re: [Numpy-discussion] f2py NotImplementedError

2016-07-26 Thread Aronne Merrelli
Hello Andy, I'm not an expert on f2py, but I've used it in a few cases. I can recreate a NotImplementedError by copying your commands. The problem is that you are using -l (lower case L), which I think is supposed to specify the library name, not a path. The NotImplementedError is not really what

Re: [Numpy-discussion] Equivalent to IDL's help function

2013-10-07 Thread Aronne Merrelli
There isn't anything quite the same. (I think what you are really asking for is a way to print the essential info about one variable name, at least that is how I would use the IDL "help" procedure). In IPython, I use the whos magic to do something similar, although it just prints this info for all

Re: [Numpy-discussion] Unique() function and avoiding Loop

2013-07-10 Thread Aronne Merrelli
On Fri, Jul 5, 2013 at 4:20 AM, Bakhtiyor Zokhidov < bakhtiyor_zokhi...@mail.ru> wrote: > Hi everybody, > > I have a problem with sorting out the following function. What I expect is > that I showed as an example below. > > Two problems are encountered to achieve the result: > 1) The function some

Re: [Numpy-discussion] array manupulation

2013-05-26 Thread Aronne Merrelli
On Sun, May 26, 2013 at 4:30 AM, Sudheer Joseph wrote: > Dear Brian, > I even tried below but no luck! > In [138]: xx=np.zeros(11) > In [139]: xx > Out[139]: array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]) > > In [147]: xx.shape > Out[147]: (11,) > In [140]: xx=np.ar

Re: [Numpy-discussion] Indexing bug

2013-04-05 Thread Aronne Merrelli
On Sun, Mar 31, 2013 at 12:14 AM, Ivan Oseledets wrote: Oh! So it is not a bug, it is a feature, which is completely > incompatible with other array based languages (MATLAB and Fortran). To > me, I can not find a single explanation why it is so in numpy. > Taking submatrices from a matrix is a

[Numpy-discussion] help with f2py

2012-12-23 Thread Aronne Merrelli
Hi, I'm trying to run f2py and running into some trouble. Starting from http://www.scipy.org/Cookbook/F2Py, and the very simple 'Wrapping Hermite Polynomial' example, I can get the pyf file created with no issues. The system I am using is RedHat linux, and has several Fortran compilers: $ f2py -c

[Numpy-discussion] __array_wrap__ and dot

2012-08-22 Thread Aronne Merrelli
Hello list, I posted an issue many months ago [1] about confusing __array_wrap__ behavior in a subclass of np.matrix. Since that time I wasn't really using the code that used the matrix subclass, but lately I have starting using the code so I've run into the issue again. Looking into a little more

Re: [Numpy-discussion] Problems understanding histogram2d

2012-07-20 Thread Aronne Merrelli
On Fri, Jul 20, 2012 at 10:11 AM, Andreas Hilboll wrote: > Hi, > > I have a problem using histogram2d: > >from numpy import linspace, histogram2d >bins_x = linspace(-180., 180., 360) >bins_y = linspace(-90., 90., 180) >data_x = linspace(-179.96875, 179.96875, 5760) >data_y = li

Re: [Numpy-discussion] record arrays initialization

2012-05-02 Thread Aronne Merrelli
On Wed, May 2, 2012 at 6:46 PM, Kevin Jacobs wrote: > On Wed, May 2, 2012 at 7:25 PM, Aronne Merrelli > wrote: >> >> In general this is a good suggestion - I was going to mention it >> earlier - but I think for this particular problem it is not better >> tha

Re: [Numpy-discussion] record arrays initialization

2012-05-02 Thread Aronne Merrelli
On Wed, May 2, 2012 at 5:27 PM, Kevin Jacobs wrote: > On Wed, May 2, 2012 at 5:45 PM, Moroney, Catherine M (388D) > wrote: >> >> Thanks to Perry for some very useful off-list conversation.   I realize >> that >> I wasn't being clear at all in my earlier description of the problem so >> here it i

Re: [Numpy-discussion] record arrays and vectorizing

2012-05-02 Thread Aronne Merrelli
On Wed, May 2, 2012 at 1:06 PM, Moroney, Catherine M (388D) wrote: > Hello, > > Can somebody give me some hints as to how to code up this function > in pure python, rather than dropping down to Fortran? > > I will want to compare a 7-element vector (called "element") to a large list > of similarl

Re: [Numpy-discussion] NumPy EIG much slower than MATLAB EIG

2012-04-02 Thread Aronne Merrelli
On Sun, Apr 1, 2012 at 8:28 AM, Kamesh Krishnamurthy wrote: > Hello all, > > I profiled NumPy EIG and MATLAB EIG on the same Macbook pro, and both were > linking to the Accelerate framework BLAS. NumPy turns out to be ~4x slower. > I've posted details on Stackoverflow: > http://stackoverflow.com/q

Re: [Numpy-discussion] Logical indexing and higher-dimensional arrays.

2012-02-08 Thread Aronne Merrelli
On Wed, Feb 8, 2012 at 8:49 AM, Travis Oliphant wrote: > > On Feb 8, 2012, at 8:29 AM, Sturla Molden wrote: > > > On 08.02.2012 06:01, Travis Oliphant wrote: > > > >> Recall that the shape of the output with fancy indexing is determined > by broadcasting together the indexing objects and using th

Re: [Numpy-discussion] matrix indexing

2012-02-07 Thread Aronne Merrelli
On Mon, Feb 6, 2012 at 11:44 AM, Naresh Pai wrote: > I have two large matrices, say, ABC and DEF, each with a shape of 7000 by > 4500. I have another list, say, elem, containing 850 values from ABC. I am > interested in finding out the corresponding values in DEF where ABC has > elem and store th

[Numpy-discussion] Help with f2py in MacPorts environment

2012-02-01 Thread Aronne Merrelli
Hello, I'm trying to do a simple test with f2py, using the Hermite polynomial example here: http://www.scipy.org/Cookbook/F2Py I cannot figure out how to configure the compile/build commands to work with my system. I'm a novice at this stuff, so please bear with me... I'm running on Mac OS X, and

Re: [Numpy-discussion] advanced indexing bug with huge arrays?

2012-01-23 Thread Aronne Merrelli
On Mon, Jan 23, 2012 at 1:33 PM, Travis Oliphant wrote: > Can you determine where the problem is, precisely.In other words, can > you verify that c is not getting filled in correctly? > > You are no doubt going to get overflow in the summation as you have a > uint8 parameter. But, having tha

Re: [Numpy-discussion] find location of maximum values

2012-01-09 Thread Aronne Merrelli
On Mon, Jan 9, 2012 at 7:59 PM, questions anon wrote: > thank you, I seem to have made some progress (with lots of help)!! > I still seem to be having trouble with the time. Because it is hourly data > for a whole month I assume that is where my problem lies. > When I run the following code I alwa

[Numpy-discussion] unexpected behavior of __array_wrap__ in matrix subclass

2011-12-22 Thread Aronne Merrelli
Hello NumPy list, While experimenting with a subclass of numpy.matrix, I discovered cases where __array_wrap__ is not called during multiplication. I'm not sure whether this is a bug or my own misunderstanding of np.matrix & __array_wrap__; if nothing else I thought it would be helpful to describe

Re: [Numpy-discussion] output different columns of ndarray in different formats

2011-12-22 Thread Aronne Merrelli
On Thu, Dec 22, 2011 at 10:27 AM, Chao YUE wrote: > Dear all, > > Just a small question, how can I output different columns of ndarray in > different formats, > the manual says, "A single format (%10.5f), a sequence of formats, or a > multi-format string" > but I use > > np.savetxt('new.csv',data

Re: [Numpy-discussion] numpy.mean problems

2011-12-10 Thread Aronne Merrelli
On Sat, Dec 10, 2011 at 5:47 AM, ferreirafm wrote: > > > Hi Stéfan, > Thanks for your replay. Have a look in the arrays at: > http://ompldr.org/vYm83ZA > Regards, > Fred > -- I can recreate this error if tab is a structured ndarray - what is the dtype of tab? If that is correct, I think you co

Re: [Numpy-discussion] numpy.matrix subclassing

2011-10-25 Thread Aronne Merrelli
On Mon, Oct 24, 2011 at 5:54 PM, David Voong wrote: > Hi guys, > > I have a question regarding subclassing of the numpy.matrix class. > > I read through the wiki page, > http://docs.scipy.org/doc/numpy/user/basics.subclassing.html > > and tried to subclass numpy.matrix, I find that if I override

Re: [Numpy-discussion] Float128 integer comparison

2011-10-15 Thread Aronne Merrelli
On Sat, Oct 15, 2011 at 1:12 PM, Matthew Brett wrote: > Hi, > > Continuing the exploration of float128 - can anyone explain this behavior? > > >>> np.float64(9223372036854775808.0) == 9223372036854775808L > True > >>> np.float128(9223372036854775808.0) == 9223372036854775808L > False > >>> int(np.

Re: [Numpy-discussion] Preventing an ndarray subclass from returning new subclass instances for std(), etc

2011-09-19 Thread Aronne Merrelli
On Sun, Sep 18, 2011 at 3:58 PM, Wes McKinney wrote: > > I thought maybe you can intercept 0-dim objects and return self.item() > in array_finalize, but not dice. This is really weird: > > import numpy as np > > class example(np.ndarray): > >def __new__(cls, arr): >return np.array(arr

Re: [Numpy-discussion] Best way to construct/slice 3-dimensional ndarray from multiple 2d ndarrays?

2011-08-17 Thread Aronne Merrelli
On Wed, Aug 17, 2011 at 9:04 AM, Keith Hughitt wrote: > > Also, when subclassing ndarray and calling obj = data.view(cls) for an > ndarray "data", does this copy the data into the new object by value or > reference? The method which extracts the 2d slice actually returns a > subclass of ndarray cr

[Numpy-discussion] __array_wrap__ / __array_finalize__ in NumPy v1.4+

2011-08-14 Thread Aronne Merrelli
Hello, I'm attempting to implement a subclass of ndarray, and becoming confused about the way __array_wrap__ and __array_finalize__ operate. I boiled it down to a short subclass, which is the example on the website at http://docs.scipy.org/doc/numpy-1.6.0/user/basics.subclassing.html, with one add