Re: [Numpy-discussion] How to start at line # x when using numpy.memmap

2011-08-19 Thread Brent Pedersen
On Fri, Aug 19, 2011 at 9:09 AM, Jeremy Conlin wrote: > On Fri, Aug 19, 2011 at 8:01 AM, Brent Pedersen wrote: >> On Fri, Aug 19, 2011 at 7:29 AM, Jeremy Conlin wrote: >>> On Fri, Aug 19, 2011 at 7:19 AM, Pauli Virtanen wrote: >>>> Fri, 19 Aug 2011 07:00:31 -0600

Re: [Numpy-discussion] How to start at line # x when using numpy.memmap

2011-08-19 Thread Brent Pedersen
On Fri, Aug 19, 2011 at 7:29 AM, Jeremy Conlin wrote: > On Fri, Aug 19, 2011 at 7:19 AM, Pauli Virtanen wrote: >> Fri, 19 Aug 2011 07:00:31 -0600, Jeremy Conlin wrote: >>> I would like to use numpy's memmap on some data files I have. The first >>> 12 or so lines of the files contain text (header

Re: [Numpy-discussion] Memmap with multiprocessing

2011-04-27 Thread Brent Pedersen
On Wed, Apr 27, 2011 at 4:07 PM, Christoph Gohlke wrote: > I don't think this was working correctly in numpy 1.4 either. The > underlying problem seems to be that instance attributes of ndarray > subtypes get lost during pickling: > > import pickle > import numpy as np > class aarray(np.ndarray):

Re: [Numpy-discussion] moving window product

2011-03-21 Thread Brent Pedersen
On Mon, Mar 21, 2011 at 11:57 AM, Keith Goodman wrote: > On Mon, Mar 21, 2011 at 10:34 AM, Brent Pedersen wrote: >> On Mon, Mar 21, 2011 at 11:19 AM, Keith Goodman wrote: >>> On Mon, Mar 21, 2011 at 10:10 AM, Brent Pedersen wrote: >>>> hi, is there a way to take

Re: [Numpy-discussion] moving window product

2011-03-21 Thread Brent Pedersen
On Mon, Mar 21, 2011 at 11:19 AM, Keith Goodman wrote: > On Mon, Mar 21, 2011 at 10:10 AM, Brent Pedersen wrote: >> hi, is there a way to take the product along a 1-d array in a moving >> window? -- similar to convolve, with product in place of sum? >> currently, i'm

[Numpy-discussion] moving window product

2011-03-21 Thread Brent Pedersen
hi, is there a way to take the product along a 1-d array in a moving window? -- similar to convolve, with product in place of sum? currently, i'm column_stacking the array with offsets of itself into window_size columns and then taking the product at axis 1. like:: w = np.column_stack(a[i:-windo

Re: [Numpy-discussion] 2D binning

2010-06-01 Thread Brent Pedersen
On Tue, Jun 1, 2010 at 1:51 PM, Wes McKinney wrote: > On Tue, Jun 1, 2010 at 4:49 PM, Zachary Pincus > wrote: >>> Hi >>> Can anyone think of a clever (non-lopping) solution to the following? >>> >>> A have a list of latitudes, a list of longitudes, and list of data >>> values. All lists are the

Re: [Numpy-discussion] [Patch] Fix memmap pickling

2010-05-26 Thread Brent Pedersen
On Mon, May 24, 2010 at 3:37 PM, Gael Varoquaux wrote: > On Mon, May 24, 2010 at 03:33:09PM -0700, Brent Pedersen wrote: >> On Mon, May 24, 2010 at 3:25 PM, Gael Varoquaux >> wrote: >> > Memmapped arrays don't pickle right. I know that to get them to >> >

Re: [Numpy-discussion] [Patch] Fix memmap pickling

2010-05-24 Thread Brent Pedersen
On Mon, May 24, 2010 at 3:25 PM, Gael Varoquaux wrote: > Memmapped arrays don't pickle right. I know that to get them to > really pickle and restore identically, we would need some effort. > However, in the current status, pickling and restoring a memmapped array > leads to tracebacks that seem li

Re: [Numpy-discussion] faster code

2010-05-16 Thread Brent Pedersen
On Sun, May 16, 2010 at 12:14 PM, Davide Lasagna wrote: > Hi all, > What is the fastest and lowest memory consumption way to compute this? > y = np.arange(2**24) > bases = y[1:] + y[:-1] > Actually it is already quite fast, but i'm not sure whether it is occupying > some temporary memory > is the

Re: [Numpy-discussion] patch to pickle np.memmap

2010-04-20 Thread Brent Pedersen
On Tue, Apr 13, 2010 at 8:59 PM, Brent Pedersen wrote: > On Tue, Apr 13, 2010 at 8:52 PM, Brent Pedersen wrote: >> hi, i posted a patch to allow pickling of np.memmap objects. >> http://projects.scipy.org/numpy/ticket/1452 >> >> currently, it always returns 'r&#x

Re: [Numpy-discussion] patch to pickle np.memmap

2010-04-13 Thread Brent Pedersen
On Tue, Apr 13, 2010 at 8:52 PM, Brent Pedersen wrote: > hi, i posted a patch to allow pickling of np.memmap objects. > http://projects.scipy.org/numpy/ticket/1452 > > currently, it always returns 'r' for the mode. > is that the best thing to do there? > any other chan

[Numpy-discussion] patch to pickle np.memmap

2010-04-13 Thread Brent Pedersen
hi, i posted a patch to allow pickling of np.memmap objects. http://projects.scipy.org/numpy/ticket/1452 currently, it always returns 'r' for the mode. is that the best thing to do there? any other changes? -brent ___ NumPy-Discussion mailing list NumPy-

Re: [Numpy-discussion] Name of the file associated with a memmap

2010-04-12 Thread Brent Pedersen
On Mon, Apr 12, 2010 at 3:31 PM, Brent Pedersen wrote: > On Mon, Apr 12, 2010 at 3:08 PM, Robert Kern wrote: >> On Mon, Apr 12, 2010 at 17:00, Brent Pedersen wrote: >>> On Mon, Apr 12, 2010 at 2:46 PM, Robert Kern wrote: >>>> On Mon, Apr 12, 2010 at 16:43, Gael V

Re: [Numpy-discussion] Name of the file associated with a memmap

2010-04-12 Thread Brent Pedersen
On Mon, Apr 12, 2010 at 3:08 PM, Robert Kern wrote: > On Mon, Apr 12, 2010 at 17:00, Brent Pedersen wrote: >> On Mon, Apr 12, 2010 at 2:46 PM, Robert Kern wrote: >>> On Mon, Apr 12, 2010 at 16:43, Gael Varoquaux >>> wrote: >>>> On Mon, Apr 12, 2010

Re: [Numpy-discussion] Name of the file associated with a memmap

2010-04-12 Thread Brent Pedersen
On Mon, Apr 12, 2010 at 2:46 PM, Robert Kern wrote: > On Mon, Apr 12, 2010 at 16:43, Gael Varoquaux > wrote: >> On Mon, Apr 12, 2010 at 04:39:23PM -0500, Robert Kern wrote: >>> > where should i write the docs? in the file itself or through the doc >>> > editor? also re path, since it can be a fil

Re: [Numpy-discussion] Name of the file associated with a memmap

2010-04-12 Thread Brent Pedersen
On Mon, Apr 12, 2010 at 1:59 PM, Robert Kern wrote: > On Mon, Apr 12, 2010 at 15:52, Charles R Harris > wrote: >> >> On Mon, Apr 12, 2010 at 2:37 PM, Charles R Harris >> wrote: >>> >>> On Mon, Apr 12, 2010 at 1:55 PM, Brent Pedersen >>> wrote

Re: [Numpy-discussion] Name of the file associated with a memmap

2010-04-12 Thread Brent Pedersen
On Mon, Apr 12, 2010 at 9:49 AM, Robert Kern wrote: > On Mon, Apr 12, 2010 at 04:03, Nadav Horesh wrote: >> >> Is there a way to get the file-name given a memmap array object? > > Not at this time. This would be very useful, though, so patches are welcome. > > -- > Robert Kern > > "I have come to

Re: [Numpy-discussion] Utility function to find array items are in ascending order

2010-02-09 Thread Brent Pedersen
On Tue, Feb 9, 2010 at 7:42 AM, Vishal Rana wrote: > Hi, > Is there any utility function to find if values in the array are in > ascending or descending order. > Example: > arr = [1, 2, 4, 6] should return true > arr2 = [1, 0, 2, -2] should return false > Thanks > Vishal > > __

[Numpy-discussion] documenting optional out parameter

2009-10-25 Thread Brent Pedersen
hi, i've seen this section: http://docs.scipy.org/numpy/Questions+Answers/#the-out-argument should _all_ functions with an optional out parameter have exactly that text? so if i find a docstring with reasonable, but different doc for out, should it be changed to that? and if a docstring of a func

Re: [Numpy-discussion] vectorizing

2009-06-05 Thread Brent Pedersen
On Fri, Jun 5, 2009 at 2:01 PM, Keith Goodman wrote: > On Fri, Jun 5, 2009 at 1:22 PM, Brent Pedersen wrote: >> On Fri, Jun 5, 2009 at 1:05 PM, Keith Goodman wrote: >>> On Fri, Jun 5, 2009 at 1:01 PM, Keith Goodman wrote: >>>> On Fri, Jun 5, 2009 at 12:53 PM,   wr

Re: [Numpy-discussion] vectorizing

2009-06-05 Thread Brent Pedersen
On Fri, Jun 5, 2009 at 1:27 PM, Keith Goodman wrote: > On Fri, Jun 5, 2009 at 1:22 PM, Brent Pedersen wrote: >> On Fri, Jun 5, 2009 at 1:05 PM, Keith Goodman wrote: >>> On Fri, Jun 5, 2009 at 1:01 PM, Keith Goodman wrote: >>>> On Fri, Jun 5, 2009 at 12:53 PM,   wr

Re: [Numpy-discussion] vectorizing

2009-06-05 Thread Brent Pedersen
On Fri, Jun 5, 2009 at 1:05 PM, Keith Goodman wrote: > On Fri, Jun 5, 2009 at 1:01 PM, Keith Goodman wrote: >> On Fri, Jun 5, 2009 at 12:53 PM,   wrote: >>> On Fri, Jun 5, 2009 at 2:07 PM, Brian Blais wrote: Hello, I have a vectorizing problem that I don't see an obvious way to solve.  

Re: [Numpy-discussion] loadtxt slow

2009-03-01 Thread Brent Pedersen
On Sun, Mar 1, 2009 at 11:29 AM, Michael Gilbert wrote: > On Sun, 1 Mar 2009 16:12:14 -0500 Gideon Simpson wrote: > >> So I have some data sets of about 16 floating point numbers stored >> in text files.  I find that loadtxt is rather slow.  Is this to be >> expected?  Would it be faster if it

Re: [Numpy-discussion] loadtxt issues

2009-02-10 Thread Brent Pedersen
On Tue, Feb 10, 2009 at 9:40 PM, A B wrote: > Hi, > > How do I write a loadtxt command to read in the following file and > store each data point as the appropriate data type: > > 12|h|34.5|44.5 > 14552|bbb|34.5|42.5 > > Do the strings have to be read in separately from the numbers? > > Why would a

Re: [Numpy-discussion] Comparison of arrays

2009-02-09 Thread Brent Pedersen
On Mon, Feb 9, 2009 at 6:02 AM, Neil wrote: > >> > I have two integer arrays of different shape, e.g. >> > >> > >>> a >> > >> > array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) >> > >> > >>> b >> > >> > array([ 3, 4, 5, 6, 7, 8, 9, 10]) >> > >> > How can I extract the values that belong to th

Re: [Numpy-discussion] genfromtxt view with object dtype

2009-02-04 Thread Brent Pedersen
g fields we observed...). > Let me know how it goes. > P. > that fixes it. thanks again pierre! -b > On Feb 4, 2009, at 4:03 PM, Brent Pedersen wrote: > >> On Wed, Feb 4, 2009 at 9:36 AM, Pierre GM >> wrote: >>> >>> On Feb 4, 2009, at 12:09 PM, Brent Pede

Re: [Numpy-discussion] Renaming a field of an object array

2009-02-04 Thread Brent Pedersen
On Wed, Feb 4, 2009 at 2:50 PM, Pierre GM wrote: > All, > I'm a tad puzzled by the following behavior (I'm trying to correct a > bug in genfromtxt): > > I'm creating an empty structured ndarray, using np.object as dtype. > > >>> a = np.empty(1,dtype=[('',np.object)]) > array([(None,)], > dt

Re: [Numpy-discussion] genfromtxt view with object dtype

2009-02-04 Thread Brent Pedersen
On Wed, Feb 4, 2009 at 9:36 AM, Pierre GM wrote: > > On Feb 4, 2009, at 12:09 PM, Brent Pedersen wrote: > >> hi, i am using genfromtxt, with a dtype like this: >> [('seqid', '|S24'), ('source', '|S16'), ('type', '|S16&

[Numpy-discussion] genfromtxt view with object dtype

2009-02-04 Thread Brent Pedersen
hi, i am using genfromtxt, with a dtype like this: [('seqid', '|S24'), ('source', '|S16'), ('type', '|S16'), ('start', 'http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] genfromtxt

2009-01-21 Thread Brent Pedersen
On Wed, Jan 21, 2009 at 9:39 PM, Pierre GM wrote: > Brent, > Mind trying r6330 and let me know if it works for you ? Make sure that > you use names=True to detect a header. > P. > yes, works perfectly. thanks! -brent ___ Numpy-discussion mailing list Nu

[Numpy-discussion] genfromtxt

2009-01-21 Thread Brent Pedersen
hi, i'm using the new genfromtxt stuff in numpy svn, looks great pierre any who contributed. is there a way to have the header commented and still be able to have it recognized as the header? e.g. #gender age weight M 21 72.10 F 35 58.33 M 33 21.99 if i use np.loadtxt or genfromt

Re: [Numpy-discussion] numpy array change notifier?

2008-10-27 Thread Brent Pedersen
On Mon, Oct 27, 2008 at 2:45 PM, Ryan May <[EMAIL PROTECTED]> wrote: > Brent Pedersen wrote: >> On Mon, Oct 27, 2008 at 1:56 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >>> On Mon, Oct 27, 2008 at 15:54, Erik Tollerud <[EMAIL PROTECTED]> wrote: >>>>

Re: [Numpy-discussion] numpy array change notifier?

2008-10-27 Thread Brent Pedersen
On Mon, Oct 27, 2008 at 1:56 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, Oct 27, 2008 at 15:54, Erik Tollerud <[EMAIL PROTECTED]> wrote: >> Is there any straightforward way of notifying on change of a numpy >> array that leaves the numpy arrays still efficient? > > Not currently, no. > > -

Re: [Numpy-discussion] array gymnastics

2008-09-11 Thread Brent Pedersen
On Thu, Sep 11, 2008 at 6:03 PM, Alan Jackson <[EMAIL PROTECTED]> wrote: > There has got to be a simple way to do this, but I'm just not seeing it. > a = array([[1,2,3,4,5,6], > [7,8,9,10,11,12]]) b = array([21,22,23,24,25,26]) > > What I want to end up with is : > > c = arra

Re: [Numpy-discussion] a good polygon class?

2008-08-19 Thread Brent Pedersen
hi, http://pypi.python.org/pypi/Shapely supports the array interface, and has all the geos geometry operations: http://gispython.org/shapely/manual.html#contains On Tue, Aug 19, 2008 at 8:31 AM, mark <[EMAIL PROTECTED]> wrote: > Hello List - > > I am looking for a good polygon class. > > My main i

Re: [Numpy-discussion] How to speed up this function?

2006-12-05 Thread Brent Pedersen
it looks like you could use weave.blitz() without much change to your code. or weave.inline() if needed. see this page: http://scipy.org/PerformancePython On 12/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hello, I'm taking a CFD class, one of the codes I wrote runs very slow. When I loo