[Numpy-discussion] String manipulation

2009-04-23 Thread Nils Wagner
Hi all, How can I obtain the position of the minus sign within the following string ? liste[1] '1.5-te' Nils ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] String manipulation

2009-04-23 Thread Francesc Alted
A Thursday 23 April 2009, Nils Wagner escrigué: Hi all, How can I obtain the position of the minus sign within the following string ? liste[1] '1.5-te' That's easy by using basic weaponery in Python: In [8]: liste[1].find('-') Out[8]: 3 In [9]: liste[1][3] Out[9]: '-' -- Francesc

Re: [Numpy-discussion] Masking an array with another array

2009-04-23 Thread josef . pktd
On Thu, Apr 23, 2009 at 1:24 AM, Gökhan SEVER gokhanse...@gmail.com wrote: Ahaa,, Thanks Gaël. That method is more elegance than the previous inputs, and the simplest of all. Although one line of import this says: There should be one-- and preferably only one --obvious way to do it. I

[Numpy-discussion] bug in stats.randint

2009-04-23 Thread Flavio Coelho
Hi, I stumbled upon something I think is a bug in scipy: In [4]: stats.randint(1.,15.).ppf([.1,.2,.3,.4,.5]) Out[4]: array([ 2., 3., 5., 6., 7.]) When you pass float arguments to stats.randint and then call the ppf method, you get an array of floats, which clearly wrong. The rvs method

[Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread David Cournapeau
Hi, I looked more in detail on what would be needed to port numpy to py3k. In particular, I was interested at the possible strategies to keep one single codebase for both python 2.x and python 3.x. The first step is to remove all py3k warnings reported by python 2.6. A couple of recurrent

Re: [Numpy-discussion] NaN as dictionary key?

2009-04-23 Thread josef . pktd
2009/4/20 Wes McKinney wesmck...@gmail.com: I assume that, because NaN != NaN, even though both have the same hash value (hash(NaN) == -32768), that Python treats any NaN double as a distinct key in a dictionary. In [76]: a = np.repeat(nan, 10) In [77]: d = {} In [78]: for i, v in

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread Pauli Virtanen
Thu, 23 Apr 2009 22:38:21 +0900, David Cournapeau kirjoitti: [clip] I looked more in detail on what would be needed to port numpy to py3k. In particular, I was interested at the possible strategies to keep one single codebase for both python 2.x and python 3.x. The first step is to remove

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread Bruce Southey
David Cournapeau wrote: Hi, I looked more in detail on what would be needed to port numpy to py3k. In particular, I was interested at the possible strategies to keep one single codebase for both python 2.x and python 3.x. The first step is to remove all py3k warnings reported by python

Re: [Numpy-discussion] Masking an array with another array

2009-04-23 Thread Neil Crighton
josef.pktd at gmail.com writes: setmember1d is very fast compared to the other solutions for large b. However, setmember1d requires that both arrays only have unique elements. So it doesn't work if, for example, your first array is a data vector with member ship in different groups

Re: [Numpy-discussion] bug in stats.randint

2009-04-23 Thread josef . pktd
On Thu, Apr 23, 2009 at 9:56 AM, josef.p...@gmail.com wrote: On Thu, Apr 23, 2009 at 9:27 AM, Flavio Coelho fccoe...@gmail.com wrote: Hi, I stumbled upon something I think is a bug in scipy: In [4]: stats.randint(1.,15.).ppf([.1, .2,.3,.4,.5]) Out[4]: array([ 2.,  3.,  5.,  6.,  7.])

Re: [Numpy-discussion] NaN as dictionary key?

2009-04-23 Thread Bruce Southey
josef.p...@gmail.com wrote: 2009/4/20 Wes McKinney wesmck...@gmail.com: I assume that, because NaN != NaN, even though both have the same hash value (hash(NaN) == -32768), that Python treats any NaN double as a distinct key in a dictionary. In [76]: a = np.repeat(nan, 10) In [77]: d =

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread David Cournapeau
On Thu, Apr 23, 2009 at 11:20 PM, Pauli Virtanen p...@iki.fi wrote: Thu, 23 Apr 2009 22:38:21 +0900, David Cournapeau kirjoitti: [clip]     I looked more in detail on what would be needed to port numpy to py3k. In particular, I was interested at the possible strategies to keep one single

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread David Cournapeau
On Thu, Apr 23, 2009 at 11:21 PM, Bruce Southey bsout...@gmail.com wrote: I agree that a single code base should be used if possible however there are a lot of C code changes required as well as Python code changes: http://www.scipy.org/Python3k

Re: [Numpy-discussion] bug in stats.randint

2009-04-23 Thread Flavio Coelho
On Thu, Apr 23, 2009 at 2:56 PM, josef.p...@gmail.com wrote: On Thu, Apr 23, 2009 at 9:27 AM, Flavio Coelho fccoe...@gmail.com wrote: Hi, I stumbled upon something I think is a bug in scipy: In [4]: stats.randint(1.,15.).ppf([.1, .2,.3,.4,.5]) Out[4]: array([ 2., 3., 5., 6.,

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread Ryan May
On Thu, Apr 23, 2009 at 9:52 AM, David Cournapeau courn...@gmail.comwrote: On Thu, Apr 23, 2009 at 11:20 PM, Pauli Virtanen p...@iki.fi wrote: Thu, 23 Apr 2009 22:38:21 +0900, David Cournapeau kirjoitti: [clip] I looked more in detail on what would be needed to port numpy to py3k. In

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread Christopher Barker
Ryan May wrote: On Thu, Apr 23, 2009 at 9:52 AM, David Cournapeau courn...@gmail.com But replacing print is not as easy as reduce. Things like print yoyo, a do not work, for example. I think the point is that you can just change it to print(yoyo) which will work in both python 2.x

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread Ryan May
On Thu, Apr 23, 2009 at 11:23 AM, Christopher Barker chris.bar...@noaa.govwrote: Ryan May wrote: On Thu, Apr 23, 2009 at 9:52 AM, David Cournapeau courn...@gmail.com But replacing print is not as easy as reduce. Things like print yoyo, a do not work, for example. I think the

Re: [Numpy-discussion] bug in stats.randint

2009-04-23 Thread josef . pktd
On Thu, Apr 23, 2009 at 11:18 AM, Flavio Coelho fccoe...@gmail.com wrote: On Thu, Apr 23, 2009 at 2:56 PM, josef.p...@gmail.com wrote: On Thu, Apr 23, 2009 at 9:27 AM, Flavio Coelho fccoe...@gmail.com wrote: Hi, I stumbled upon something I think is a bug in scipy: In [4]:

[Numpy-discussion] numpy 1.3.0 test() failures on ubuntu 9.04

2009-04-23 Thread Chris Colbert
Hi all, I'm building numpy 1.3.0 from source with libatlas-sse2-dev from the jaunty repos. I'm running into 16 failures when running the nose test. This is a fresh install of 9.04 and i've repod the following packages: build-essential swig gfortran python-dev libatlas-sse2-dev libatlas-base-dev

Re: [Numpy-discussion] numpy 1.3.0 test() failures on ubuntu 9.04

2009-04-23 Thread Pauli Virtanen
Thu, 23 Apr 2009 14:54:10 -0400, Chris Colbert wrote: [clip] libatlas-sse2-dev [clip] The pastebin links to site.cfg build.log and test.log are at the end of this email. If anyone could help me out here as to what the problems may be, i would appreciate it! The SSE-optimized Atlas libraries

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread Robert Kern
On Thu, Apr 23, 2009 at 09:52, David Cournapeau courn...@gmail.com wrote: On Thu, Apr 23, 2009 at 11:20 PM, Pauli Virtanen p...@iki.fi wrote: Thu, 23 Apr 2009 22:38:21 +0900, David Cournapeau kirjoitti: [clip]     I looked more in detail on what would be needed to port numpy to py3k. In

Re: [Numpy-discussion] numpy 1.3.0 test() failures on ubuntu 9.04

2009-04-23 Thread Michael Abshoff
Pauli Virtanen wrote: Thu, 23 Apr 2009 14:54:10 -0400, Chris Colbert wrote: [clip] libatlas-sse2-dev [clip] The pastebin links to site.cfg build.log and test.log are at the end of this email. If anyone could help me out here as to what the problems may be, i would appreciate it! The

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread ross smith
On Thu, Apr 23, 2009 at 15:39, Robert Kern robert.k...@gmail.com wrote: On Thu, Apr 23, 2009 at 09:52, David Cournapeau courn...@gmail.com wrote: On Thu, Apr 23, 2009 at 11:20 PM, Pauli Virtanen p...@iki.fi wrote: Thu, 23 Apr 2009 22:38:21 +0900, David Cournapeau kirjoitti: [clip] I

Re: [Numpy-discussion] numpy 1.3.0 test() failures on ubuntu 9.04

2009-04-23 Thread David Cournapeau
On Fri, Apr 24, 2009 at 7:59 AM, Michael Abshoff michael.absh...@googlemail.com wrote: Pauli Virtanen wrote: Thu, 23 Apr 2009 14:54:10 -0400, Chris Colbert wrote: [clip] libatlas-sse2-dev [clip] The pastebin links to site.cfg build.log and test.log are at the end of this email. If anyone

[Numpy-discussion] patching docs

2009-04-23 Thread william ratcliff
Hi! I'd like to suggest a patch for: numpy http://docs.scipy.org/numpy/docs/numpy/.corehttp://docs.scipy.org/numpy/docs/numpy.core/ .fromnumeric http://docs.scipy.org/numpy/docs/numpy.core.fromnumeric/.put The docstring contains: for i, val in zip(ind,v): x.flat[i]=val It should be: for i,

Re: [Numpy-discussion] Porting strategy for py3k

2009-04-23 Thread David Cournapeau
Christopher Barker wrote: Though I'm a bit surprised that that's not how the print function is written in the first place (maybe it is in py3k -- I'm testing on 2.5) That's actually how it works as far as I can tell. The thing with removing those print is that we can do it without too much

Re: [Numpy-discussion] patching docs

2009-04-23 Thread Stéfan van der Walt
Hi William Please sign up for an account on the docs editor at http://docs.scipy.org Regards Stéfan 2009/4/24 william ratcliff william.ratcl...@gmail.com: Hi!  I'd like to suggest a patch for: numpy.core.fromnumeric.put [...] This would be more consistent with the rest of the docstring. 

Re: [Numpy-discussion] patching docs

2009-04-23 Thread william ratcliff
I signed up for an account as williamratcliff May I have edit rights? Thanks, William 2009/4/24 Stéfan van der Walt ste...@sun.ac.za Hi William Please sign up for an account on the docs editor at http://docs.scipy.org Regards Stéfan 2009/4/24 william ratcliff