[Numpy-discussion] Import patch

2011-04-04 Thread Paul Anton Letnes
Hi. When looking at the loadtxt/savetxt tickets, I noticed that the 're' module is imported in an odd place. I therefore suggest that this import is moved to the top of the file, in order to gather these as much as possible. I find the code easier to read then. After all, there is no 'try /

[Numpy-discussion] division operator

2011-04-04 Thread Alex Ter-Sarkissov
I have 2 variables, say var1=10,var2=100. To divide I do either divide(float(var1),float(var2)) or simply float(var1)/float(var2). I'm just wondering if there's a smarter way of doing this? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] division operator

2011-04-04 Thread andrew nelson
var1 = 10 var2 = 100 import numpy as np np.divide(var1,var2) 0 np.divide(10,100 * 1.) 0.10001 var1/var2 0 var1*1./var2 0.1 On 04/04/2011, at 8:49 PM, Alex Ter-Sarkissov wrote: I have 2 variables, say var1=10,var2=100. To divide I do either divide(float(var1),float(var2)) or

Re: [Numpy-discussion] division operator

2011-04-04 Thread Pearu Peterson
On 04/04/2011 01:49 PM, Alex Ter-Sarkissov wrote: I have 2 variables, say var1=10,var2=100. To divide I do either divide(float(var1),float(var2)) or simply float(var1)/float(var2). I'm just wondering if there's a smarter way of doing this? from __future__ import division var1 = 10 var2

Re: [Numpy-discussion] division operator

2011-04-04 Thread Alan G Isaac
On 4/4/2011 6:49 AM, Alex Ter-Sarkissov wrote: divide(float(var1),float(var2)) http://docs.scipy.org/doc/numpy/reference/generated/numpy.true_divide.html hth, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] Import patch

2011-04-04 Thread Charles R Harris
On Sun, Apr 3, 2011 at 4:35 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi. When looking at the loadtxt/savetxt tickets, I noticed that the 're' module is imported in an odd place. I therefore suggest that this import is moved to the top of the file, in order to gather these as

Re: [Numpy-discussion] Import patch

2011-04-04 Thread Paul Anton Letnes
On 4. apr. 2011, at 15.34, Charles R Harris wrote: On Sun, Apr 3, 2011 at 4:35 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi. When looking at the loadtxt/savetxt tickets, I noticed that the 're' module is imported in an odd place. I therefore suggest that this import

Re: [Numpy-discussion] Import patch

2011-04-04 Thread Charles R Harris
On Mon, Apr 4, 2011 at 8:29 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On 4. apr. 2011, at 15.34, Charles R Harris wrote: On Sun, Apr 3, 2011 at 4:35 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: Hi. When looking at the loadtxt/savetxt tickets, I noticed

Re: [Numpy-discussion] Import patch

2011-04-04 Thread Paul Anton Letnes
On 4. apr. 2011, at 16.42, Charles R Harris wrote: On Mon, Apr 4, 2011 at 8:29 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On 4. apr. 2011, at 15.34, Charles R Harris wrote: On Sun, Apr 3, 2011 at 4:35 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote:

Re: [Numpy-discussion] Import patch

2011-04-04 Thread Charles R Harris
On Mon, Apr 4, 2011 at 8:57 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On 4. apr. 2011, at 16.42, Charles R Harris wrote: On Mon, Apr 4, 2011 at 8:29 AM, Paul Anton Letnes paul.anton.let...@gmail.com wrote: On 4. apr. 2011, at 15.34, Charles R Harris wrote:

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-04-04 Thread Bruce Southey
On 03/31/2011 12:02 PM, Derek Homeier wrote: On 31 Mar 2011, at 17:03, Bruce Southey wrote: This is an invalid ticket because the docstring clearly states that in 3 different, yet critical places, that missing values are not handled here: Each row in the text file must have the same number

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-04-04 Thread Charles R Harris
On Mon, Apr 4, 2011 at 9:59 AM, Bruce Southey bsout...@gmail.com wrote: On 03/31/2011 12:02 PM, Derek Homeier wrote: On 31 Mar 2011, at 17:03, Bruce Southey wrote: This is an invalid ticket because the docstring clearly states that in 3 different, yet critical places, that missing values

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-04-04 Thread Bruce Southey
On 04/04/2011 11:20 AM, Charles R Harris wrote: On Mon, Apr 4, 2011 at 9:59 AM, Bruce Southey bsout...@gmail.com mailto:bsout...@gmail.com wrote: On 03/31/2011 12:02 PM, Derek Homeier wrote: On 31 Mar 2011, at 17:03, Bruce Southey wrote: This is an invalid ticket because

Re: [Numpy-discussion] loadtxt/savetxt tickets

2011-04-04 Thread Charles R Harris
On Mon, Apr 4, 2011 at 11:01 AM, Bruce Southey bsout...@gmail.com wrote: On 04/04/2011 11:20 AM, Charles R Harris wrote: On Mon, Apr 4, 2011 at 9:59 AM, Bruce Southey bsout...@gmail.com wrote: On 03/31/2011 12:02 PM, Derek Homeier wrote: On 31 Mar 2011, at 17:03, Bruce Southey wrote:

[Numpy-discussion] How to create structured char arrays?

2011-04-04 Thread Bruce Southey
Hi, I think that I have resolved my issue down to creating a structured string array. I am using numpy version '2.0.0.dev-3c338cb'. Without a structured array, it should be a 2 by 2 array: np.array([('a','b'),('c','d')]) array([['a', 'b'], ['c', 'd']], dtype='|S1')

[Numpy-discussion] python3 setup.py install fails with git maint/1.6.x

2011-04-04 Thread Darren Dale
I just checkout out the 1.6 branch, attempted to install with python3: RefactoringTool: Line 695: You should use a for loop here Running from numpy source directory.Traceback (most recent call last): File setup.py, line 196, in module setup_package() File setup.py, line 170, in

[Numpy-discussion] Best dot product along an axis?

2011-04-04 Thread Skipper Seabold
Going through some of the recent threads on similar problems, I'm trying to discern which is best. I have X is T x i, theta is T x i x j. I want a T by j array that contains X[t].T.dot(theta[t]) along axis 0. Say, T,i,j = 166,7,3 X = np.random.random((T,i)) theta = np.random.random((T,i,j)) #

Re: [Numpy-discussion] How to create structured char arrays?

2011-04-04 Thread Derek Homeier
Hi Bruce, I think that I have resolved my issue down to creating a structured string array. I am using numpy version '2.0.0.dev-3c338cb'. Without a structured array, it should be a 2 by 2 array: np.array([('a','b'),('c','d')]) array([['a', 'b'], ['c', 'd']], dtype='|S1')

Re: [Numpy-discussion] python3 setup.py install fails with git maint/1.6.x

2011-04-04 Thread Ralf Gommers
On Mon, Apr 4, 2011 at 9:15 PM, Darren Dale dsdal...@gmail.com wrote: I just checkout out the 1.6 branch, attempted to install with python3: I hope you mean the 1.6.0b1 tarball, not the current branch head? This problem is (or should have been) fixed. Just tried again with python3.2 and

Re: [Numpy-discussion] python3 setup.py install fails with git maint/1.6.x

2011-04-04 Thread Darren Dale
On Mon, Apr 4, 2011 at 3:31 PM, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Mon, Apr 4, 2011 at 9:15 PM, Darren Dale dsdal...@gmail.com wrote: I just checkout out the 1.6 branch, attempted to install with python3: I hope you mean the 1.6.0b1 tarball, not the current branch head? This

Re: [Numpy-discussion] python3 setup.py install fails with git maint/1.6.x

2011-04-04 Thread Charles R Harris
On Mon, Apr 4, 2011 at 1:31 PM, Ralf Gommers ralf.gomm...@googlemail.comwrote: On Mon, Apr 4, 2011 at 9:15 PM, Darren Dale dsdal...@gmail.com wrote: I just checkout out the 1.6 branch, attempted to install with python3: I hope you mean the 1.6.0b1 tarball, not the current branch head? This

Re: [Numpy-discussion] python3 setup.py install fails with git maint/1.6.x

2011-04-04 Thread Derek Homeier
On 4 Apr 2011, at 21:41, Darren Dale wrote: Just tried again with python3.2 and 1.6.0b2, installs fine. The line it fails on is only reached when a numpy/version.py exists, which is the case for source releases or if you did not clean your local git repo before building. ... but I think

[Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread Ralf Gommers
Hi, I am pleased to announce the availability of the second beta of NumPy 1.6.0. Due to the extensive changes in the Numpy core for this release, the beta testing phase will last at least one month. Please test this beta and report any problems on the Numpy mailing list. Many bug fixes went in

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread Derek Homeier
Hi all, On 4 Apr 2011, at 22:04, Ralf Gommers wrote: I am pleased to announce the availability of the second beta of NumPy 1.6.0. Due to the extensive changes in the Numpy core for this release, the beta testing phase will last at least one month. Please test this beta and report any

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread Charles R Harris
On Mon, Apr 4, 2011 at 8:42 PM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: Hi all, On 4 Apr 2011, at 22:04, Ralf Gommers wrote: I am pleased to announce the availability of the second beta of NumPy 1.6.0. Due to the extensive changes in the Numpy core for this release,

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread josef . pktd
On Mon, Apr 4, 2011 at 11:42 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Apr 4, 2011 at 8:42 PM, Derek Homeier de...@astro.physik.uni-goettingen.de wrote: Hi all, On 4 Apr 2011, at 22:04, Ralf Gommers wrote: I am pleased to announce the availability of the second beta

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread Christoph Gohlke
On 4/4/2011 1:04 PM, Ralf Gommers wrote: Hi, I am pleased to announce the availability of the second beta of NumPy 1.6.0. Due to the extensive changes in the Numpy core for this release, the beta testing phase will last at least one month. Please test this beta and report any problems on

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread josef . pktd
On Tue, Apr 5, 2011 at 12:10 AM, Christoph Gohlke cgoh...@uci.edu wrote: On 4/4/2011 1:04 PM, Ralf Gommers wrote: Hi, I am pleased to announce the availability of the second beta of NumPy 1.6.0. Due to the extensive changes in the Numpy core for this release, the beta testing phase will

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread Chris Barker
On 4/4/11 9:03 PM, josef.p...@gmail.com wrote: On Mon, Apr 4, 2011 at 11:42 PM, Charles R Harris File /sw/lib/python2.4/site-packages/numpy/lib/_datasource.py, line 477, in open return _file_openers[ext](found, mode=mode) IOError: invalid mode: Ub Guess that wasn't tested before

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 2

2011-04-04 Thread Charles R Harris
On Mon, Apr 4, 2011 at 11:22 PM, Chris Barker chris.bar...@noaa.gov wrote: On 4/4/11 9:03 PM, josef.p...@gmail.com wrote: On Mon, Apr 4, 2011 at 11:42 PM, Charles R Harris File /sw/lib/python2.4/site-packages/numpy/lib/_datasource.py, line 477, in open return