Re: [Numpy-discussion] trouble installing on fedora core 5 64 bit

2006-06-07 Thread Charles R Harris
JJ,I had that problem, started to put the paths in explicitly, noticed that the code should work anyway, deleted my changes, ran again, and it worked fine. I can't tell you what the problem was or what the solution was, I can only say I've seen the same thing on fc5. When you do install, it is

Re: [Numpy-discussion] finding connected areas?

2006-06-12 Thread Charles R Harris
Stephen,I don't know of a data structure in numpy or scipy that does this. To do this myself I use a modified union/find (equivalence relation) algorithm interfaced to python using boost/python. The same algorithm is also useful for connecting points on the basis of equivalence relations other

Re: [Numpy-discussion] Time for beta1 of NumPy 1.0

2006-07-01 Thread Charles R Harris
On 6/30/06, Robert Kern [EMAIL PROTECTED] wrote: Travis Oliphant wrote: Comments?Whatever else you do, leave arange() alone. It should never have accepted floatsin the first place.Hear, hear. Using floats in arange is a lousy temptation that must be avoided. Apart from that I think that making

Re: [Numpy-discussion] Time for beta1 of NumPy 1.0

2006-07-01 Thread Charles R Harris
Thanks Travis,Your directions are very helpful and much appreciated.ChuckOn 7/1/06, Travis Oliphant [EMAIL PROTECTED] wrote:Charles R Harris wrote: On 6/30/06, *Robert Kern* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Travis Oliphant wrote: Comments? Whatever else you do, leave arange()

Re: [Numpy-discussion] Args for ones, zeros, rand, eye, ones, empty (possible 1.0 change?)

2006-07-03 Thread Charles R Harris
snip+1 for tuples,Because dimensions *are* tuples. I think using tuples is a good habit to get into and agree with Robert Kern's comments about using the new random number interface instead of the old compatibility functions rand and randn. Chuck Using Tomcat but need to do more? Need to support

Re: [Numpy-discussion] Call for a vote on .M .A .T .H attributes

2006-07-07 Thread Charles R Harris
Does anyone use transpose for anything besides two dimensional arrays? For arrays that aren't matrices at heart the meaning of transpose is pretty arbitrary, so the only virtue I see in having an attribute would be less typeing. So put it in the documentation. As an aside, being able to specify

Re: [Numpy-discussion] Enhancing dot()

2006-07-07 Thread Charles R Harris
On 7/7/06, Bill Baxter [EMAIL PROTECTED] wrote: On 7/7/06, Tim Hochberg [EMAIL PROTECTED] wrote: The funny thing is that having a dot(a,b,c,...) would lead to the exact same kind of hidden performance problems you're arguing against.Not exactly arguing -- this isn't why I don't like H and

Re: [Numpy-discussion] .M .A .T .H attribute result

2006-07-08 Thread Charles R Harris
Hi all,On 7/8/06, Fernando Perez [EMAIL PROTECTED] wrote: Hi all,On 7/7/06, Travis Oliphant [EMAIL PROTECTED] wrote: I didn't compile the results, but the discussion on the idea of adding new attributes to the array object led to the following result. Added:.T attribute to mean

Re: [Numpy-discussion] generalized_inverse

2006-07-16 Thread Charles R Harris
On 7/15/06, Travis Oliphant [EMAIL PROTECTED] wrote: Victoria G. Laidler wrote: Jonathan Taylor wrote:snip It's not that we're concerned with MATLAB compatibility.But, franklyI've never heard that the short names MATLAB uses for some very commonoperations are a liability. So, when a common

Re: [Numpy-discussion] Mean of n values within an array

2006-07-29 Thread Charles R Harris
Hmmm,I rewrote the subroutine a bit.def numpy_nmean(list,n): a = numpy.empty(len(list),dtype=float) b = numpy.cumsum(list) for i in range(0,len(list)): if i n : a[i] = b[i]/(i+1) else : a[i] = (b[i] - b[i-n])/(i+1) return a and gotregular python took: 0.75 sec.numpy took: 0.38

Re: [Numpy-discussion] fixing diag() for matrices

2006-07-29 Thread Charles R Harris
Hi Sven,On 7/28/06, Sven Schreiber [EMAIL PROTECTED] wrote: Here's my attempt at summarizing the diag-discussion.snip 2) Deprecate the use of diag which is overloaded with making diagonalmatrices as well as getting diagonals. Instead, use the existing.diagonal() for getting a diagonal, and

Re: [Numpy-discussion] Graph class

2006-08-01 Thread Charles R Harris
Hi David,I often have several thousand nodes in a graph, sometimes clustered into connected components. I suspect that using an adjacency matrix is an inefficient representation for graphs of that size while for smaller graphs the overhead of more complicated structures wouldn't be noticeable.

[Numpy-discussion] Whitespace

2006-08-18 Thread Charles R Harris
Hi All, I've noticed a lot of trailing whitespace while browsing through the numpy subversion repository. So here is a perl script I pinched from the linux-kernel mailing list that does a good job of removing it. Chuck cleanfile Description: Binary data

Re: [Numpy-discussion] Array pooling

2006-08-22 Thread Charles R Harris
On 8/22/06, Carlos Pita [EMAIL PROTECTED] wrote: Hi! I'm writting a real time sound synthesis framework where processing units are interconnected via numpy arrays. These buffers are all the same size and type, so it would be easy and convenient pooling them in order to avoid excesive

Re: [Numpy-discussion] Array pooling

2006-08-23 Thread Charles R Harris
Hi Carlos,On 8/22/06, Carlos Pita [EMAIL PROTECTED] wrote: One reason is to use operator syntax: buf1 = buf2 + buf3, instead of add(buf2,buf3, buf1). The other is to spare the final user (synth programmer) any buffer bookkeeping. I see. My idea was to keep track of pooled buffers' reference

Re: [Numpy-discussion] coercion rules for float32 in numpy are different from numarray

2006-08-25 Thread Charles R Harris
Hi,On 8/25/06, Travis Oliphant [EMAIL PROTECTED] wrote: Sebastian Haase wrote: This is now the behavior in SVN. Note that this is different from both Numeric (which gave an error) and numarray (which coerced to float32). But, it is consistent with how mixed-types are handled in calculations and

Re: [Numpy-discussion] round() bug

2006-08-26 Thread Charles R Harris
Hi,On 8/26/06, Sven Schreiber [EMAIL PROTECTED] wrote: Hi,is this normal behavior?: import numpy as n; print n.mat(0.075).round(2); printn.mat(0.575).round(2)[[ 0.08]][[ 0.57]] In [7]: (arange(100)*.5).round()Out[7]: array([ 0., 0., 1., 2., 2., 2., 3., 4., 4., 4., 5., 6., 6., 6., 7., 8., 8., 8.,

Re: [Numpy-discussion] memory corruption bug

2006-08-26 Thread Charles R Harris
Hi,On 8/26/06, Bill Baxter [EMAIL PROTECTED] wrote: You're sure it's not just pass-by-reference semantics biting you?If you make an array and pass it to another class or function, by default they just get a reference to the same array.so e.g.:a = numpy.array ([1,2,3])some_class.set_array(a)a[1] =

Re: [Numpy-discussion] Deleting a row from a matrix

2006-08-26 Thread Charles R Harris
Hi,On 8/26/06, Keith Goodman [EMAIL PROTECTED] wrote: On 8/26/06, Bill Baxter [EMAIL PROTECTED] wrote: On 8/26/06, Travis Oliphant [EMAIL PROTECTED] wrote: I've come up with adding the functions (not methods at this point) deletefrom insertinto delete and insert really would be better. The

Re: [Numpy-discussion] std(axis=1) memory footprint issues + moving avg / stddev

2006-08-26 Thread Charles R Harris
On 8/26/06, Torgil Svensson [EMAIL PROTECTED] wrote: Hindarray.std(axis=1) seems to have memory issues on large 2D-arrays. Ifirst thought I had a performance issue but discovered that std() usedlots of memory and therefore caused lots of swapping.I want to get an array where element i is the

Re: [Numpy-discussion] attributes of scalar types - e.g. numpy.int32.itemsize

2006-08-26 Thread Charles R Harris
Hi,On 8/18/06, Sebastian Haase [EMAIL PROTECTED] wrote:snip Thanks, that seems to be a handy dictionary-like objectJust for the record - in the meantime I found this: N.dtype(N.int32).itemsize4And on x86_64 linux python ints are 8 bytes.In [15]: asarray([1])[0].itemsize Out[15]: 8Interesting.

Re: [Numpy-discussion] bad generator behaviour with sum

2006-08-27 Thread Charles R Harris
Hi,On 8/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE-Hash: SHA1It seems like numpy.sum breaks generator expressions:In [1]: sum(i*i for i in range(10))Out[1]: 285In [2]: from numpy import sumIn [3]: sum(i*i for i in range(10)) Out[3]: generator object at

Re: [Numpy-discussion] bad generator behaviour with sum

2006-08-27 Thread Charles R Harris
Hi Christopher,On 8/27/06, Charles R Harris [EMAIL PROTECTED] wrote: Hi,On 8/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE-Hash: SHA1It seems like numpy.sum breaks generator expressions:In [1]: sum(i*i for i in range(10))Out[1]: 285In [2]: from numpy import

Re: [Numpy-discussion] Constant array

2006-08-28 Thread Charles R Harris
Hi Carlos,On 8/27/06, Carlos Pita [EMAIL PROTECTED] wrote: Hi all!Is there a more efficient way of creating a constant K-valued array of size N than:zeros(N) + K?Maybe something like this:I n [12]: a = empty((3,3), dtype=int)In [13]: a.fill(11) In [14]: aOut[14]: array([[11, 11, 11], [11, 11,

[Numpy-discussion] Documentation

2006-08-29 Thread Charles R Harris
Hi All,I've finished moving all the docstrings in arraymethods to add_newdocs. Much of the documentation is still incomplete and needs nicer formatting, so if you are so inclined, or even annoyed with some of the help messages, feel free to fix things up. Chuck

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Charles R Harris
Hi Travis,On 8/29/06, Travis Oliphant [EMAIL PROTECTED] wrote: Hi all,Classes start for me next Tuesday, and I'm teaching a class for which Iwill be using NumPy / SciPy extensively.I need to have a release ofthese two (and hopefully matplotlib) that work with each other. Therefore, I'm going to

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Charles R Harris
Hi Fernando,On 8/29/06, Fernando Perez [EMAIL PROTECTED] wrote: On 8/29/06, Charles R Harris [EMAIL PROTECTED] wrote: Speaking of features, I wonder if more of the methods should return references. For instance, it might be nice to write something like: a.sort().searchsorted([...]) instead

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Charles R Harris
Hi,On 8/29/06, Tim Hochberg [EMAIL PROTECTED] wrote: -0.5 from me if what we're talking about here is having mutating methodsreturn self rather than None. Chaining stuff is pretty, but havingmethods that mutate self and return self looks like a source of elusive bugs to me.-timBut how is that any

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Charles R Harris
On 8/29/06, Tim Hochberg [EMAIL PROTECTED] wrote: Charles R Harris wrote: Hi, On 8/29/06, *Tim Hochberg* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: -0.5 from me if what we're talking about here is having mutating methods return self rather than None. Chaining stuff is pretty, but having

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Charles R Harris
Hi Tim,On 8/29/06, Tim Hochberg [EMAIL PROTECTED] wrote: Charles R Harris wrote: On 8/29/06, *Tim Hochberg* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Charles R Harris wrote: Hi, On 8/29/06, *Tim Hochberg* [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Charles R Harris
Hi,On 8/29/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:I find it much cleaner to writex = foo.bar().baz(param).frob() thanfoo.bar()foo.baz(param)x = foo.frob()but perhaps others disagree.Both of these look clean but i do not think that moving 3 lines to oneline makes code cleanerThey both do

Re: [Numpy-discussion] Release of 1.0b5 this weekend

2006-08-29 Thread Charles R Harris
On 8/29/06, Tim Hochberg [EMAIL PROTECTED] wrote: David M. Cooke wrote: On Tue, 29 Aug 2006 14:03:39 -0700 Tim Hochberg [EMAIL PROTECTED] wrote: Of these,clip, conjugate and round support an 'out' argument like that supported by ufunces;byteswap has a boolean argument telling it whether to

Re: [Numpy-discussion] stumped numpy user seeks help

2006-08-29 Thread Charles R Harris
On 8/29/06, Keith Goodman [EMAIL PROTECTED] wrote: On 8/29/06, Mathew Yeates [EMAIL PROTECTED] wrote: I have an M by N array of floats. Associated with the columns are character labels ['a','b','b','c','d','e','e','e']note: already sorted so duplicates are contiguous I want to replace the 2 'b'

Re: [Numpy-discussion] array indexing problem

2006-08-29 Thread Charles R Harris
On 8/29/06, Rahul Kanwar [EMAIL PROTECTED] wrote: Hello, I am trying to extract a column from a 2D array here is what is havedone:In [3]: a = array([[1,2,3],[1,2,3]])In [4]: aOut[4]:array([[1, 2, 3], [1, 2, 3]])In [5]: a[:, 1]Out[5]: array([2, 2])In

Re: [Numpy-discussion] upcast

2006-08-30 Thread Charles R Harris
On 8/30/06, Lars Friedrich [EMAIL PROTECTED] wrote: Hello,I would like to discuss the following code:#***start***import numpy as Na = N.array((200), dtype = N.uint8)print (a * 100) / 100b = N.array((200, 200), dtype = N.uint8)print (b * 100) / 100 #***stop***The first print statement will print

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Charles R Harris
On 8/31/06, Fernando Perez [EMAIL PROTECTED] wrote: On 8/31/06, Travis Oliphant [EMAIL PROTECTED] wrote: What about N.array(3).size N.array([3]).size N.array ([3,3]).size Essentially, the [] is being treated as an object when you explicitly ask for an object array in exactly the same way as 3 is

Re: [Numpy-discussion] possible bug with numpy.object_

2006-08-31 Thread Charles R Harris
On 8/31/06, Christopher Barker [EMAIL PROTECTED] wrote: Fernando Perez wrote: In [8]: N.array(3).shape Out[8]: () In [11]: N.array([]).shape Out[11]: (0,) I guess my only remaining question is: what is the difference between outputs #8 and #11 above?Is an empty shape tuple == array scalar, while

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Tom Denniston [EMAIL PROTECTED] wrote: But i have hetergenious arrays that have numbers and strings and NoneType, etc.Take for instance:In [11]: numpy.array([numpy.array([1,'A', None]),numpy.array([2,2,'Some string'])], dtype=object)Out[11]: array([[1, A, None], [2, 2, Some string]],

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Charles R Harris [EMAIL PROTECTED] wrote: On 8/31/06, Tom Denniston [EMAIL PROTECTED] wrote: But i have hetergenious arrays that have numbers and strings and NoneType, etc.Take for instance:In [11]: numpy.array([numpy.array([1,'A', None]),numpy.array([2,2,'Some string'])], dtype

Re: [Numpy-discussion] dtype=object behavior change from 0.9.6 to beta 1

2006-08-31 Thread Charles R Harris
On 8/31/06, Christopher Barker [EMAIL PROTECTED] wrote: Tom Denniston wrote: I would think one would want to throw an error when the data has inconsistent dimensions.But it doesn't have inconsistent dimensions - they are perfectlyconsistent with a (2,) array of objects. How is the code to know

[Numpy-discussion] Keyword added to searchsorted.

2006-09-02 Thread Charles R Harris
Hi all,I added the keyword side to the searchsorted method and functions. Documentation:a.searchsorted(values=v, side='left') - array of indices. Required Arguments: v -- keys to be searched for in a. Keyword arguments side -- {'left', 'right'}, default('left'). If a is a 1-D array in

[Numpy-discussion] diagflat

2006-09-03 Thread Charles R Harris
Travis has introduced the function diagflat for creating diagonal arrays. It flattens whatever array is supplied and returns its values as the diagonal of a 2-D array or matrix. As the function is currently undocumented I thought now might be a good time to discuss other possible choices for the

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-03 Thread Charles R Harris
On 9/3/06, Fernando Perez [EMAIL PROTECTED] wrote: Hi all,I'm wondering if the following difference in behavior of object arrays shouldbe considered a bug.Let a and b be:In [21]: a = [0,1]In [22]: b = [ None, None]If we concatenate a with an empty list, it works: In [23]:

[Numpy-discussion] Random number generators

2006-09-03 Thread Charles R Harris
Hi Robert,I am about to get started on some stuff for the random number generators but thought I would run it by you first. I envisage the following:uniform short_doubles -- doubles generated from a single 32 bit random number (advantage: speed) uniform double, short_doubles on the interval (0,1)

Re: [Numpy-discussion] Random number generators

2006-09-04 Thread Charles R Harris
On 9/3/06, Robert Kern [EMAIL PROTECTED] wrote: Charles R Harris wrote: Hi Robert, I am about to get started on some stuff for the random number generators but thought I would run it by you first. I envisage the following: uniform short_doubles -- doubles generated from a single 32 bit random

Re: [Numpy-discussion] bug in round with negative number of decimals

2006-09-04 Thread Charles R Harris
On 9/4/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/4/06, Sebastian Haase [EMAIL PROTECTED] wrote: Paulo J. S. Silva wrote: Once again, the information that singed zero is part of IEEE standard is in the paper I cited in my last message. It is very important to be able to compute the sign

Re: [Numpy-discussion] Irregular arrays

2006-09-04 Thread Charles R Harris
On 9/4/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: The question is whether numpy has such support; if not, is it planned. No, and no.Thank you for answering, and I am sorry to hear that.I will be dropping my membership on the scipy-numpy email list shortly.Many systems handle rectangular

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/5/06, Travis Oliphant [EMAIL PROTECTED] wrote: Matthew Brett wrote: Hi, This is a result of PyArray_FromAny changing when object arrays are explicitly requested (which they are in this case --- although behind the scenes). Hmm - I think I am hitting a related bug/feature/surprising change in

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/6/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/6/06, Travis Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: Where is array at this point?Basically it supports the old Numeric behavior wherein object array'sare treated as before *except* for when an error would have

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/7/06, Travis Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: On 9/6/06, *Charles R Harris* [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: On 9/6/06, *Travis Oliphant* [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote

Re: [Numpy-discussion] ndarray.count() ?

2006-09-07 Thread Charles R Harris
On 9/7/06, Martin Spacek [EMAIL PROTECTED] wrote: What's the most straightforward way to count, say, the number of 1s orTrues in the array? Or the number of any integer? I was surprised to discover recently that there isn't a count() methodas there is for Python lists. Sorry if this has been

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Travis Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: So is this intentional? In [24]: a = array([[],[],[]], dtype=object) In [25]: a.shape Out[25]: (3, 0) In [26]: a = array([], dtype=object) In [27]: a.shape Out[27]: (0,) One could argue that the first array should have

Re: [Numpy-discussion] rfft different in numpy vs scipy

2006-09-07 Thread Charles R Harris
On 9/7/06, Andrew Jaffe [EMAIL PROTECTED] wrote: Hi all,It seems that scipy and numpy define rfft differently.numpy returns n/2+1 complex numbers (so the first and last numbers areactually real) with the frequencies equivalent to the positive part of the fftfreq, whereas scipy returns n real

Re: [Numpy-discussion] rfft different in numpy vs scipy

2006-09-07 Thread Charles R Harris
On 9/7/06, Andrew Jaffe [EMAIL PROTECTED] wrote: Hi Charles,Charles R Harris wrote: On 9/7/06, *Andrew Jaffe* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi all, It seems that scipy and numpy define rfft differently. numpy returns n/2+1 complex numbers (so the first and last numbers

Re: [Numpy-discussion] NumPy 1.0 release-candidate 1.0 this weekend

2006-09-13 Thread Charles R Harris
On 9/13/06, Travis Oliphant [EMAIL PROTECTED] wrote: I'd like to make the first release-candidate of NumPy 1.0 this weekend.Any additions wanting to make the first official release candidateshould be checked in by then.There are a few cleanups and added functionality I have in mind but nothing

Re: [Numpy-discussion] NumPy 1.0 release-candidate 1.0 this weekend

2006-09-14 Thread Charles R Harris
On 9/14/06, Victoria G. Laidler [EMAIL PROTECTED] wrote: Francesc Altet wrote:El dj 14 de 09 del 2006 a les 02:11 -0700, en/na Andrew Straw vaescriure:My main focus is on the fact that you might read 'i4' asless than 4-bytes int, which is very confusing ! I can agree it's confusing at first, but

Re: [Numpy-discussion] degree matrix construction

2006-09-15 Thread Charles R Harris
On 9/15/06, Satya Upadhya [EMAIL PROTECTED] wrote: Dear Friends,my question is the following:Suppose i have the following code: from LinearAlgebra import * from Numeric import * A = [1,2,1,3,1,3,4,1,2] B = reshape(A,(3,3)) C = sum(B,1) Carray([4, 7, 7]) Now, my problem is to construct a degree

Re: [Numpy-discussion] visual programming

2006-09-18 Thread Charles R Harris
On 9/18/06, Mathew Yeates [EMAIL PROTECTED] wrote: semi off topic.Does anyone know of any good visual programming tools? Forever ago, Iused to use something called Khoros for image processing and I found itvery useful. You connect boxes which represent different processing steps. At about the same

Re: [Numpy-discussion] max argmax combo

2006-09-18 Thread Charles R Harris
On 9/18/06, Bill Baxter [EMAIL PROTECTED] wrote: On 9/19/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/18/06, Bill Baxter [EMAIL PROTECTED] wrote: I find myself often wanting both the max and the argmax of an array. (And same for the other arg* functions) You have to do something like

Re: [Numpy-discussion] max argmax combo

2006-09-18 Thread Charles R Harris
On 9/18/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/18/06, Bill Baxter [EMAIL PROTECTED] wrote: On 9/19/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/18/06, Bill Baxter [EMAIL PROTECTED] wrote: I find myself often wanting both the max and the argmax of an array. (And same

Re: [Numpy-discussion] max argmax combo

2006-09-19 Thread Charles R Harris
On 9/19/06, Francesc Altet [EMAIL PROTECTED] wrote: A Dimarts 19 Setembre 2006 07:18, Charles R Harris va escriure: I note that argsort also produces indexes that are hard to use in the ndim1 case.Perhaps it is worth to mention here that I've always liked to have a sort() and argsort

Re: [Numpy-discussion] max argmax combo

2006-09-19 Thread Charles R Harris
On 9/19/06, Francesc Altet [EMAIL PROTECTED] wrote: A Dimarts 19 Setembre 2006 19:21, Charles R Harris va escriure: On 9/19/06, Francesc Altet [EMAIL PROTECTED] wrote: A Dimarts 19 Setembre 2006 07:18, Charles R Harris va escriure: I note that argsort also produces indexes that are hard to use

Re: [Numpy-discussion] Resolution of tickets.

2006-09-19 Thread Charles R Harris
On 9/19/06, Travis Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: Question, How does one mark a ticket as fixed? I don't see this field in the ticket views I get, is there a list of accepted fixers?You have to be logged in to the Trac site.If you have SVN write access you should be able

Re: [Numpy-discussion] max argmax combo

2006-09-19 Thread Charles R Harris
On 9/19/06, Bill Baxter [EMAIL PROTECTED] wrote: On 9/20/06, Francesc Altet [EMAIL PROTECTED] wrote: A Dimarts 19 Setembre 2006 19:21, Charles R Harris va escriure: Do you want both the indexes and index sorted array returned, or just sort the array using indexes, i.e., something like a.sort

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread Charles R Harris
On 9/19/06, Tim Hochberg [EMAIL PROTECTED] wrote: A. M. Archibald wrote: On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote: Keith Goodman wrote: In what order would you like argsort to sort the values -inf, nan, inf? Ideally, -inf should sort first, inf should sort last and nan should raise an

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread Charles R Harris
On 9/19/06, Tim Hochberg [EMAIL PROTECTED] wrote: Charles R Harris wrote: On 9/19/06, *Tim Hochberg* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: A. M. Archibald wrote: On 19/09/06, Tim Hochberg [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: Keith Goodman wrote: In what order would

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread Charles R Harris
On 9/19/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 19/09/06, Charles R Harris [EMAIL PROTECTED] wrote: If this sort of thing can cause unexpected errors I wonder if it would be worth it to have a global debugging flag that essentially causesisnan to be called before any function

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread Charles R Harris
On 9/19/06, Tim Hochberg [EMAIL PROTECTED] wrote: Travis Oliphant wrote: Tim Hochberg wrote: A. M. Archibald wrote: On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote: I'm not sure where the breakpoint is, but I was seeing failures for all three sort types with N as high as 1. I suspect that

[Numpy-discussion] Division by zero doesn't raise exception in the integer case.

2006-09-19 Thread Charles R Harris
Travis,Is this intentional?In [77]: arange(5, dtype=int)/0 Out[77]: array([0, 0, 0, 0, 0])It looks deliberate because all zeros are returned, but it might be better if it raised an exception.Chuck - Take Surveys. Earn Cash.

Re: [Numpy-discussion] please change mean to use dtype=float

2006-09-19 Thread Charles R Harris
On 9/19/06, Travis Oliphant [EMAIL PROTECTED] wrote: Sebastian Haase wrote:On Tuesday 19 September 2006 15:48, Travis Oliphant wrote:Sebastian Haase wrote:snipcan we please change dtype to default to float64 !? The default is float64 now (as long as you are not usingnumpy.oldnumeric).I suppose

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread Charles R Harris
On 9/19/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 19/09/06, Charles R Harris [EMAIL PROTECTED] wrote: For floats we could use something like: lessthan(a,b) := a b || (a == nan b != nan) Which would put all the nans at one end and might not add too much overhead.You could put an any(isnan

Re: [Numpy-discussion] sorting -inf, nan, inf

2006-09-19 Thread Charles R Harris
On 9/19/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote: I'm still somewhat mystified by the desire to move the nans to one end of the sorted object. I see two scenarios: It's mostly to have something to do with them other than throw anexception.

Re: [Numpy-discussion] please change mean to use dtype=float

2006-09-19 Thread Charles R Harris
On 9/19/06, Charles R Harris [EMAIL PROTECTED] wrote: On 9/19/06, Sebastian Haase [EMAIL PROTECTED] wrote: Travis Oliphant wrote: Sebastian Haase wrote: I still would argue that getting a good (smaller rounding errors) answer should be the default -- if speed is wanted, then *that* could be still

Re: [Numpy-discussion] please change mean to use dtype=float

2006-09-20 Thread Charles R Harris
On 9/20/06, David M. Cooke [EMAIL PROTECTED] wrote: On Wed, Sep 20, 2006 at 03:01:18AM -0500, Robert Kern wrote: Let me offer a third path: the algorithms used for .mean() and .var() are substandard. There are much better incremental algorithms that entirely avoid the need to accumulate such

Re: [Numpy-discussion] 1.0rc1 doesn't seem to work on AMD64

2006-09-21 Thread Charles R Harris
On 9/21/06, Peter Bienstman [EMAIL PROTECTED] wrote: Hi,I just installed rc1 on an AMD64 machine. but I get this error message whentrying to import it:Python 2.4.3 (#1, Sep 21 2006, 13:06:42)[GCC 4.1.1 (Gentoo 4.1.1)] on linux2Type help, copyright, credits or license for more information. import

Re: [Numpy-discussion] Tests and code documentation

2006-09-21 Thread Charles R Harris
Hi, On 9/21/06, Robert Kern [EMAIL PROTECTED] wrote: Steve Lianoglou wrote: So .. I guess I'm wondering why we want to break from the standard?We don't as far as Python code goes. The code that Chuck added Doxygen-stylecomments to was C code. I presume he was simply answering Sebastian's question

Re: [Numpy-discussion] please change mean to use dtype=float

2006-09-22 Thread Charles R Harris
On 9/22/06, Tim Hochberg [EMAIL PROTECTED] wrote: Sebastian Haase wrote: On Thursday 21 September 2006 15:28, Tim Hochberg wrote: David M. Cooke wrote: On Thu, 21 Sep 2006 11:34:42 -0700 Tim Hochberg [EMAIL PROTECTED] wrote: Tim Hochberg wrote: Robert Kern wrote: David M. Cooke wrote: On Wed,

Re: [Numpy-discussion] Shift or rotate command?

2006-09-24 Thread Charles R Harris
On 9/24/06, Bill Baxter [EMAIL PROTECTED] wrote: Howdy Angus,Yeh, that does seem like a hole in the API.Travis added a rollaxis()but there's still no simple way to roll the elements themselves.I took a look at numpy.fft.fftshift, which is a function that has to do a similar thing.It does it by

Re: [Numpy-discussion] Segfault with 64-bit, ACML, Python 2.5

2006-09-26 Thread Charles R Harris
On 9/26/06, Nickolas V Fotopoulos [EMAIL PROTECTED] wrote: Dear numpy pros,I have a problem and I don't know whether it's from local setup intricacies(64-bit Opteron with ACML and Python 2.5) or something in numpy (fresh SVNcheckout).I observe the following: Any idea what might be wrong?One

Re: [Numpy-discussion] ide for python/numpy/scipy/mpl development ?

2006-10-06 Thread Charles R Harris
On 10/6/06, Robert Kern [EMAIL PROTECTED] wrote: Eric Emsellem wrote: Hi, I am looking for an IDE to develop python programsand I am not sure what to take. The two critical items for me are 1/ a good debugger (simple and efficient) 2/ something simple to manage the files. I would also very much

Re: [Numpy-discussion] tensor product

2006-10-08 Thread Charles R Harris
Hi Nadav,On 10/8/06, Nadav Horesh [EMAIL PROTECTED] wrote: There is a tensortdot function in numpy1.0rc1 The tensordot is not the same thing as a tensor product. What I want is the following: def tensor(a, b) : Tensor product of a and b a = asarray(a) b = asarray(b) return outer(a,

Re: [Numpy-discussion] tensor product

2006-10-09 Thread Charles R Harris
On 10/9/06, Tim Hochberg [EMAIL PROTECTED] wrote: snipIs this not the same things as numpy.multiply.outer(a, b)? (as opposed to outer(a, b), which appears to pretend that everything is a vector --I'm not sure what the point of that is).Hmmm, yes, multiply.outer does do that. I thought that outer

Re: [Numpy-discussion] ide for python/numpy/scipy/mpl, development ?

2006-10-09 Thread Charles R Harris
On 10/9/06, Pierre GM [EMAIL PROTECTED] wrote: On Monday 09 October 2006 04:20, Bill Baxter wrote: If you don't mind going commercial, then the WingIDE has been working very well for me.Did anybody mention Eclipse+pydev ? I've been a regular user for the last few months, and I'm quite happy about

Re: [Numpy-discussion] tensor product

2006-10-09 Thread Charles R Harris
On 10/9/06, Travis Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: On 10/9/06, *Tim Hochberg* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: snip Is this not the same things as numpy.multiply.outer(a, b)? (as opposed to outer(a, b), which appears to pretend that everything

Re: [Numpy-discussion] can this be made faster?

2006-10-09 Thread Charles R Harris
On 10/9/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 09/10/06, Robert Kern [EMAIL PROTECTED] wrote: Daniel Mahler wrote: In my case all a, b, c are large with b and c being orders of magnitude lareger than a. b is known to contain only, but potentially any, a-indexes,reapeated many times.

Re: [Numpy-discussion] can this be made faster?

2006-10-09 Thread Charles R Harris
On 10/9/06, A. M. Archibald [EMAIL PROTECTED] wrote: c contains arbitray floats.essentially it is to compute class totalsas in total[class[i]] += value[i] This seems like a rather common operation - I know I've needed it on at least two occasions - is it worth creating some sort of

Re: [Numpy-discussion] PIL with numpy support!

2006-10-10 Thread Charles R Harris
On 10/10/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/10/06, Christopher Barker [EMAIL PROTECTED] wrote: Hi all:Fredrik Lundh wrote: A little later that planned, but PIL 1.1.6 beta 2 is now available from SVN: http://svn.effbot.python-hosting.com/tags/pil-1.1.6b2/ A tarball will appear

Re: [Numpy-discussion] naive RNG question

2006-10-11 Thread Charles R Harris
On 10/11/06, Alan G Isaac [EMAIL PROTECTED] wrote: Python's MT documentation exmphasize the period of theMT19937 algorithm but discusses not at all the seed size.The numpy documentation contains no commentary (I believe).Speaking from a position of utter RNG ignorance, seed size seems really

Re: [Numpy-discussion] asmatrix and asarray exception

2006-10-11 Thread Charles R Harris
On 10/11/06, Keith Goodman [EMAIL PROTECTED] wrote: On 10/11/06, Keith Goodman [EMAIL PROTECTED] wrote: This works: M.asmatrix(['a', 'b', None]) matrix([[a, b, None]], dtype=object) But this doesn't: M.asmatrix(['a', 'b', None, 'c']) TypeError: expected a readable buffer objectAs a side

Re: [Numpy-discussion] Things to address for Py3K

2006-10-11 Thread Charles R Harris
On 10/11/06, Travis Oliphant [EMAIL PROTECTED] wrote: Hi all,Py3K is undergoing active development.This gives us an opportunity todiscuss more significant changes to the language that might improve theexperience of NumPy users.We should form a list and start commenting on the py3k mailing lists

Re: [Numpy-discussion] round

2006-10-11 Thread Charles R Harris
On 10/11/06, Greg Willden [EMAIL PROTECTED] wrote: Hi All,I've read discussions in the archives about how round() rounds to even and how that is supposedly better.But what I haven't been able to find is What do I use if I want the regular old round that you learn in school? Perhaps you could

Re: [Numpy-discussion] Should numpy.sqrt(-1) return 1j rather than nan?

2006-10-11 Thread Charles R Harris
On 10/11/06, Tim Hochberg [EMAIL PROTECTED] wrote: Greg Willden wrote: On 10/11/06, *Travis Oliphant* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Stefan van der Walt wrote: Further, if I understand correctly, changing sqrt and power to give the right answer by default will slow things down

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Greg Willden [EMAIL PROTECTED] wrote: Hi All,I'm using numpy.polyfit and it is giving me some really strange results when evaluated near 0. So I compared it with polyfit in matplotlib and the code and docstrings are nearly identical. However the slight differences in the code make a

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Greg Willden [EMAIL PROTECTED] wrote: On 10/12/06, Charles R Harris [EMAIL PROTECTED] wrote: I'm guessing that the rcond number in the lstsq version (default 1e-10) is the difference. Generally the lstsq version should work better than the MPL version because at*a is not as well

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/12/06, Greg Willden [EMAIL PROTECTED] wrote: On 10/12/06, Charles R Harris [EMAIL PROTECTED] wrote: I'm guessing that the rcond number in the lstsq version (default 1e-10) is the difference. Generally the lstsq version should work

Re: [Numpy-discussion] Polyfit

2006-10-12 Thread Charles R Harris
On 10/12/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/12/06, Charles R Harris [EMAIL PROTECTED] wrote: On 10/12/06, Greg Willden [EMAIL PROTECTED] wrote: On 10/12/06, Charles R Harris [EMAIL PROTECTED] wrote: I'm guessing that the rcond number in the lstsq version (default 1e-10

[Numpy-discussion] rcond in polyfit

2006-10-12 Thread Charles R Harris
Hi all,I note that polyfit looks like it should work for single and double, real and complex, polynomials. On the otherhand, the default rcond needs to depend on the underlying precision. On the other, other hand, all the svd computations are done with dgelsd or zgelsd, i.e., double precision.

Re: [Numpy-discussion] How to make sqrt(-1) be 1j

2006-10-12 Thread Charles R Harris
On 10/12/06, Bill Baxter [EMAIL PROTECTED] wrote: On 10/12/06, Stefan van der Walt [EMAIL PROTECTED] wrote: On Thu, Oct 12, 2006 at 08:58:21AM -0500, Greg Willden wrote: On 10/11/06, Bill Baxter [EMAIL PROTECTED] wrote: I tried to explain the argument at

Re: [Numpy-discussion] [SciPy-dev] NumPy/SciPy + MPI for Python

2006-10-14 Thread Charles R Harris
On 10/14/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 14/10/06, Gael Varoquaux [EMAIL PROTECTED] wrote: On Sat, Oct 14, 2006 at 06:58:45AM -0600, Bill Spotz wrote:snip I agree. Moreover, being picked for such integration work would helpencourage people to converge on one MPI interface (for

Re: [Numpy-discussion] rcond in polyfit

2006-10-14 Thread Charles R Harris
On 10/13/06, A. M. Archibald [EMAIL PROTECTED] wrote: On 13/10/06, Tim Hochberg [EMAIL PROTECTED] wrote: Charles R Harris wrote:snip On the other hand if error handling is set to 'raise', then a FloatingPointError is issued. Is a FloatingPointWarning in order to mirror the FloatingPointError

  1   2   >