Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread Warren Weckesser
On Sat, Nov 12, 2011 at 6:43 AM, josef.p...@gmail.com wrote: On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu zyzhu2...@gmail.com wrote: Hi, I am playing with multiple ways to speed up the following expression (it is in the inner loop): C[1:(M - 1)]=(a * C[2:] + b * C[1:(M-1)] + c *

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread Warren Weckesser
On Sat, Nov 12, 2011 at 9:59 AM, josef.p...@gmail.com wrote: On Sat, Nov 12, 2011 at 10:31 AM, Warren Weckesser warren.weckes...@enthought.com wrote: On Sat, Nov 12, 2011 at 6:43 AM, josef.p...@gmail.com wrote: On Sat, Nov 12, 2011 at 3:36 AM, Geoffrey Zhu zyzhu2...@gmail.com wrote

Re: [Numpy-discussion] speeding up the following expression

2011-11-12 Thread Warren Weckesser
On Sat, Nov 12, 2011 at 11:16 AM, josef.p...@gmail.com wrote: On Sat, Nov 12, 2011 at 11:32 AM, Warren Weckesser warren.weckes...@enthought.com wrote: On Sat, Nov 12, 2011 at 9:59 AM, josef.p...@gmail.com wrote: On Sat, Nov 12, 2011 at 10:31 AM, Warren Weckesser warren.weckes

Re: [Numpy-discussion] Memory hungry reduce ops in Numpy

2011-11-15 Thread Warren Weckesser
On Tue, Nov 15, 2011 at 10:48 AM, Andreas Müller amuel...@ais.uni-bonn.dewrote: ** On 11/15/2011 05:46 PM, Andreas Müller wrote: On 11/15/2011 04:28 PM, Bruce Southey wrote: On 11/14/2011 10:05 AM, Andreas Müller wrote: On 11/14/2011 04:23 PM, David Cournapeau wrote: On Mon, Nov 14,

Re: [Numpy-discussion] how to use the name of a ndarray as a string

2011-11-18 Thread Warren Weckesser
On Fri, Nov 18, 2011 at 10:40 AM, Chao YUE chaoyue...@gmail.com wrote: Thanks to all people for this very nice discussions. the solutions are more that what I want!! and help me to clarify some concepts, and really begin to use class as a beginner :) FYI: Just a day or so ago, I stumbled

Re: [Numpy-discussion] upsample or scale an array

2011-12-02 Thread Warren Weckesser
On Sat, Dec 3, 2011 at 12:35 AM, Robin Kraft rkra...@gmail.com wrote: I need to take an array - derived from raster GIS data - and upsample or scale it. That is, I need to repeat each value in each dimension so that, for example, a 2x2 array becomes a 4x4 array as follows: [[1, 2], [3, 4]]

[Numpy-discussion] Convert datetime64 to python datetime.datetime in numpy 1.6.1?

2011-12-03 Thread Warren Weckesser
In numpy 1.6.1, what's the most straightforward way to convert a datetime64 to a python datetime.datetime? E.g. I have In [1]: d = datetime64(2011-12-03 12:34:56.75) In [2]: d Out[2]: 2011-12-03 12:34:56.75 I want the same time as a datetime.datetime instance. My best hack so far is to

Re: [Numpy-discussion] Convert datetime64 to python datetime.datetime in numpy 1.6.1?

2011-12-04 Thread Warren Weckesser
On Sun, Dec 4, 2011 at 5:30 AM, Didrik Pinte dpi...@enthought.com wrote: On Sun, Dec 4, 2011 at 6:11 AM, Warren Weckesser warren.weckes...@enthought.com wrote: In numpy 1.6.1, what's the most straightforward way to convert a datetime64 to a python datetime.datetime? E.g. I have In [1

Re: [Numpy-discussion] Fast Reading of ASCII files

2011-12-12 Thread Warren Weckesser
On Mon, Dec 12, 2011 at 10:22 AM, Chris.Barker chris.bar...@noaa.govwrote: On 12/11/11 8:40 AM, Ralf Gommers wrote: On Wed, Dec 7, 2011 at 7:50 PM, Chris.Barker chris.bar...@noaa.gov * If we have a good, fast ascii (or unicode?) to array reader, hopefully it could be leveraged for

Re: [Numpy-discussion] Array min from argmin along an axis?

2011-12-13 Thread Warren Weckesser
On Tue, Dec 13, 2011 at 4:11 PM, Ken Basye kbas...@jhu.edu wrote: Hi folks, I need an efficient way to get both the min and argmin of a 2-d array along one axis. It seemed to me that the way to do this was to get the argmin and then use it to index into the array to get the min, but I

[Numpy-discussion] ufunc delegation to object method

2012-01-29 Thread Warren Weckesser
In the following code, numpy.sin() calls the object's sin() function: In [2]: class Foo(object): ...: def sin(self): ...: return spam ...: In [3]: f = Foo() In [4]: np.sin(f) Out[4]: 'spam' Is this, in fact, guaranteed behavior for a ufunc? It does not appear to be

Re: [Numpy-discussion] numpy all unexpected result (generator)

2012-01-31 Thread Warren Weckesser
On Tue, Jan 31, 2012 at 4:22 PM, Robert Kern robert.k...@gmail.com wrote: On Tue, Jan 31, 2012 at 22:17, Travis Oliphant tra...@continuum.io wrote: I also agree that an exception should be raised at the very least. It might also be possible to make the NumPy any, all, and sum functions

Re: [Numpy-discussion] ufunc delegation to object method

2012-02-01 Thread Warren Weckesser
Bump... On Mon, Jan 30, 2012 at 1:17 AM, Warren Weckesser warren.weckes...@enthought.com wrote: In the following code, numpy.sin() calls the object's sin() function: In [2]: class Foo(object): ...: def sin(self): ...: return spam ...: In [3]: f = Foo() In [4

Re: [Numpy-discussion] fast method to to count a particular value in a large matrix

2012-02-04 Thread Warren Weckesser
On Sat, Feb 4, 2012 at 2:35 PM, Benjamin Root ben.r...@ou.edu wrote: On Saturday, February 4, 2012, Naresh Pai n...@uark.edu wrote: I am somewhat new to Python (been coding with Matlab mostly). I am trying to simplify (and expedite) a piece of code that is currently a bottleneck in a

Re: [Numpy-discussion] ValueError: total size of new array must be unchanged only on Windows

2012-02-05 Thread Warren Weckesser
On Sun, Feb 5, 2012 at 12:06 PM, josef.p...@gmail.com wrote: On Sun, Feb 5, 2012 at 12:52 PM, Paolo p.zaff...@yahoo.it wrote: How I can do this? I'm not sure without trying, numpy.loadtxt might be the easier choice matrix=.join((i.strip() for i in f.readlines())) I think strip()

Re: [Numpy-discussion] avoiding loops when downsampling arrays

2012-02-06 Thread Warren Weckesser
On Mon, Feb 6, 2012 at 2:57 PM, Sturla Molden stu...@molden.no wrote: Short answer: Create 16 view arrays, each with a stride of 4 in both dimensions. Test them against the conditions and combine the tests with an |= operator. Thus you replace the nested loop with one that has only 16

Re: [Numpy-discussion] Updated differences between 1.5.1 to 1.6.1

2012-02-14 Thread Warren Weckesser
On Tue, Feb 14, 2012 at 12:25 PM, Travis Oliphant tra...@continuum.iowrote: snip There is a mailing list for numfocus that you can sign up for if you would like to be part of those discussions. Let me know if you would like more information about that. I would like more information

Re: [Numpy-discussion] repeat array along new axis without making a copy

2012-02-15 Thread Warren Weckesser
On Wed, Feb 15, 2012 at 2:25 AM, Steve Schmerler elcort...@googlemail.comwrote: Hi I'd like to repeat an array along a new axis (like broadcast): In [8]: a Out[8]: array([[0, 1, 2], [3, 4, 5]]) In [9]: b=repeat(a[None,...], 3, axis=0) In [10]: b Out[10]:

Re: [Numpy-discussion] strange behavior of numpy.random.multivariate_normal, ticket:1842

2012-02-16 Thread Warren Weckesser
On Thu, Feb 16, 2012 at 10:12 AM, Pierre Haessig pierre.haes...@crans.orgwrote: Le 16/02/2012 16:20, josef.p...@gmail.com a écrit : I don't see any way to fix multivariate_normal for this case, except for dropping svd or for random perturbing a covariance matrix with multiplicity of

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-23 Thread Warren Weckesser
On Thu, Feb 23, 2012 at 2:08 PM, Travis Oliphant tra...@continuum.iowrote: This is actually on my short-list as well --- it just didn't make it to the list. In fact, we have someone starting work on it this week. It is his first project so it will take him a little time to get up to speed

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-26 Thread Warren Weckesser
On Thu, Feb 23, 2012 at 2:19 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Thu, Feb 23, 2012 at 2:08 PM, Travis Oliphant tra...@continuum.iowrote: This is actually on my short-list as well --- it just didn't make it to the list. In fact, we have someone starting work

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-26 Thread Warren Weckesser
On Sun, Feb 26, 2012 at 1:00 PM, Nathaniel Smith n...@pobox.com wrote: On Sun, Feb 26, 2012 at 5:23 PM, Warren Weckesser warren.weckes...@enthought.com wrote: I haven't pushed it to the extreme, but the big example (in the examples/ directory) is a 1 gig text file with 2 million rows

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-26 Thread Warren Weckesser
On Sun, Feb 26, 2012 at 1:49 PM, Nathaniel Smith n...@pobox.com wrote: On Sun, Feb 26, 2012 at 7:16 PM, Warren Weckesser warren.weckes...@enthought.com wrote: On Sun, Feb 26, 2012 at 1:00 PM, Nathaniel Smith n...@pobox.com wrote: For this kind of benchmarking, you'd really rather

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-02-26 Thread Warren Weckesser
On Sun, Feb 26, 2012 at 3:00 PM, Nathaniel Smith n...@pobox.com wrote: On Sun, Feb 26, 2012 at 7:58 PM, Warren Weckesser warren.weckes...@enthought.com wrote: Right, I got that. Sorry if the placement of the notes about how to clear the cache seemed to imply otherwise. OK, cool, np

Re: [Numpy-discussion] Jaccard Hamming Problem

2012-03-01 Thread Warren Weckesser
On Thu, Mar 1, 2012 at 8:43 AM, Zayd YAKOUBI zayd.yako...@gmail.com wrote: Hello, I use the similarity measure Jaccard and Hamming of pckage Scipy.spacial.cdist (Python) in a clustering context, I applied to given typs of real and integer (0.6 0.2 1.7 May 8 ). They gave good results. But I

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-03-07 Thread Warren Weckesser
On Tue, Mar 6, 2012 at 4:45 PM, Chris Barker chris.bar...@noaa.gov wrote: On Thu, Mar 1, 2012 at 10:58 PM, Jay Bourque jayv...@gmail.com wrote: 1. Loading text files using loadtxt/genfromtxt need a significant performance boost (I think at least an order of magnitude increase in

Re: [Numpy-discussion] Fromfile Issue

2012-03-09 Thread Warren Weckesser
On Fri, Mar 9, 2012 at 7:26 AM, Nicola Creati ncre...@inogs.it wrote: Hello, I'm writing a library able to read LAS lidar files. I generally use it under Linux without any problems. I'm now testing my library on a Windows 7 64 bit computer and I meet some problems reading the file. I

Re: [Numpy-discussion] float96 on windows32 is float64?

2012-03-15 Thread Warren Weckesser
On Thu, Mar 15, 2012 at 11:41 PM, Val Kalatsky kalat...@gmail.com wrote: I does look like a joke. Here is print np.finfo(np.longdouble) In [2]: np.__version__ Out[2]: '1.6.1' In [3]: np.flo np.floatnp.float32 np.float_ np.floor np.float16 np.float64

Re: [Numpy-discussion] Possible roadmap addendum: building better text file readers

2012-03-20 Thread Warren Weckesser
On Tue, Mar 20, 2012 at 5:59 PM, Chris Barker chris.bar...@noaa.gov wrote: Warren et al: On Wed, Mar 7, 2012 at 7:49 AM, Warren Weckesser warren.weckes...@enthought.com wrote: If you are setup with Cython to build extension modules, I am and you don't mind testing an unreleased

[Numpy-discussion] SciPy 2012 - The Eleventh Annual Conference on Scientific Computing with Python

2012-04-04 Thread Warren Weckesser
SciPy 2012, the eleventh annual Conference on Scientific Computing with Python, will be held July 16–21, 2012, in Austin, Texas. At this conference, novel scientific applications and libraries related to data acquisition, analysis, dissemination and visualization using Python are presented.

Re: [Numpy-discussion] Slices from an index list

2012-04-11 Thread Warren Weckesser
On Wed, Apr 11, 2012 at 4:28 AM, Mads Ipsen madsip...@gmail.com wrote: Hi, Suppose a have an array of indices, say indices = [0,1,2,3,5,7,8,9,10,12,13,14] Then the following slices a = slice(0,4) b = slice(4,5) c = slice(5,9) d = slice(9,12) provide information about all

Re: [Numpy-discussion] SciPy 2012 - The Eleventh Annual Conference on Scientific Computing with Python

2012-04-27 Thread Warren Weckesser
, Warren Weckesser warren.weckes...@enthought.com wrote: SciPy 2012, the eleventh annual Conference on Scientific Computing with Python, will be held July 16–21, 2012, in Austin, Texas. At this conference, novel scientific applications and libraries related to data acquisition, analysis

[Numpy-discussion] SciPy 2012 Abstract and Tutorial Deadlines Extended

2012-04-30 Thread Warren Weckesser
SciPy 2012 Conference Deadlines Extended Didn't quite finish your abstract or tutorial yet? Good news: the SciPy 2012 organizers have extended the deadline until Friday, May 4. Proposals for tutorials and abstracts for talks and posters are now due by midnight (Austin time, CDT), May 4. For

Re: [Numpy-discussion] not expected output of fill_diagonal

2012-06-09 Thread Warren Weckesser
On Fri, Jun 8, 2012 at 7:45 PM, Frédéric Bastien no...@nouiz.org wrote: Hi, While reviewing the Theano op that wrap numpy.fill_diagonal, we found an unexpected behavior of it: # as expected for square matrix a=numpy.zeros((5,5)) numpy.fill_diagonal(a, 10) print a # as expected long

Re: [Numpy-discussion] dot() function question

2012-06-27 Thread Warren Weckesser
On Wed, Jun 27, 2012 at 4:38 PM, x.pi...@gmail.com wrote: Hi list. I have got completely cunfused with the numpy.dot() function. dot(A,B) does: - matrix multiplication if A and B are of MxN and NxK sizey - dot product if A and B are of size M How how can I perform matrix multiplication of

Re: [Numpy-discussion] numpy.fromfunction() doesn't work as expected?

2012-07-20 Thread Warren Weckesser
On Thu, Jul 19, 2012 at 5:52 AM, Cheng Li scrappedprince...@gmail.comwrote: Hi All, ** ** I have spot a strange behavior of numpy.fromfunction(). The sample codes are as follows: import numpy as np def myOnes(i,j): return 1.0 a =

Re: [Numpy-discussion] sum and prod

2012-09-08 Thread Warren Weckesser
On Sat, Sep 8, 2012 at 4:56 PM, nicky van foreest vanfore...@gmail.comwrote: Hi, I ran the following code: args = np.array([4,8]) print np.sum( (arg 0) for arg in args) print np.sum([(arg 0) for arg in args]) print np.prod( (arg 0) for arg in args)

Re: [Numpy-discussion] Obscure code in concatenate code path?

2012-09-13 Thread Warren Weckesser
On Thu, Sep 13, 2012 at 9:01 AM, Travis Oliphant tra...@continuum.iowrote: On Sep 13, 2012, at 8:40 AM, Nathaniel Smith wrote: On Thu, Sep 13, 2012 at 11:12 AM, Matthew Brett matthew.br...@gmail.com wrote: Hi, While writing some tests for np.concatenate, I ran foul of this code:

Re: [Numpy-discussion] set_printoptions precision and single floats

2012-10-06 Thread Warren Weckesser
On Sat, Oct 6, 2012 at 12:17 PM, Ralf Gommers ralf.gomm...@gmail.comwrote: On Fri, Oct 5, 2012 at 5:17 PM, Dan Goodman dg.gm...@thesamovar.netwrote: Hi, numpy.set_printoptions(precision=...) doesn't affect single floats, even if they are numpy floats rather than Python floats. Is this a

Re: [Numpy-discussion] matrix norm

2012-10-22 Thread Warren Weckesser
On Mon, Oct 22, 2012 at 10:56 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Mon, Oct 22, 2012 at 9:44 AM, Jason Grout jason-s...@creativetrax.comwrote: I'm curious why scipy/numpy defaults to calculating the Frobenius norm for matrices [1], when Matlab, Octave, and Mathematica

Re: [Numpy-discussion] strange behavior of numpy.unique

2012-11-06 Thread Warren Weckesser
On Tue, Nov 6, 2012 at 8:27 PM, Phillip Feldman phillip.m.feld...@gmail.com wrote: numpy.unique behaves as I would expect for small inputs like the following: In [12]: x= [0, 0, 1, 0, 1, 2, 0, 1, 2, 3] In [13]: unique(x, return_index=True) Out[13]: (array([0, 1, 2, 3]), array([0, 2, 5, 9],

Re: [Numpy-discussion] strange behavior of numpy.unique

2012-11-07 Thread Warren Weckesser
On Wed, Nov 7, 2012 at 11:24 AM, josef.p...@gmail.com wrote: On Tue, Nov 6, 2012 at 9:52 PM, Warren Weckesser warren.weckes...@gmail.com wrote: On Tue, Nov 6, 2012 at 8:27 PM, Phillip Feldman phillip.m.feld...@gmail.com wrote: numpy.unique behaves as I would expect for small inputs

Re: [Numpy-discussion] How to Keep An Array Two Dimensional

2012-11-25 Thread Warren Weckesser
On Sun, Nov 25, 2012 at 8:24 PM, Tom Bennett tom.benn...@mail.zyzhu.netwrote: Hi, I am trying to extract n columns from an 2D array and then operate on the extracted columns. Below is the code: A is an MxN 2D array. u = A[:,:n] #extract the first n columns from A B = np.dot(u, u.T)

Re: [Numpy-discussion] step paramter for linspace

2013-03-01 Thread Warren Weckesser
On 3/1/13, Henry Gomersall h...@cantab.net wrote: On Fri, 2013-03-01 at 13:34 +, Nathaniel Smith wrote: My usual hack to deal with the numerical bounds issue is to add/subtract half the step. Right. Which is exactly the sort of annoying, content-free code that a library is supposed to

Re: [Numpy-discussion] Numpy 1.7.0 with Intel MKL 11.0.2.146

2013-03-10 Thread Warren Weckesser
On 3/10/13, QT rdirect...@gmail.com wrote: Dear all, I'm at my wits end. I've followed Intel's own instructionshttp://software.intel.com/en-us/articles/numpyscipy-with-intel-mklon how to compile Numpy with Intel MKL. Everything compiled and linked fine and I've installed it locally in my

Re: [Numpy-discussion] Numpy 1.7.0 with Intel MKL 11.0.2.146

2013-03-10 Thread Warren Weckesser
On 3/10/13, Warren Weckesser warren.weckes...@gmail.com wrote: On 3/10/13, QT rdirect...@gmail.com wrote: Dear all, I'm at my wits end. I've followed Intel's own instructionshttp://software.intel.com/en-us/articles/numpyscipy-with-intel-mklon how to compile Numpy with Intel MKL. Everything

[Numpy-discussion] Add ability to disable the autogeneration of the function signature in a ufunc docstring.

2013-03-15 Thread Warren Weckesser
Hi all, In a recent scipy pull request (https://github.com/scipy/scipy/pull/459), I ran into the problem of ufuncs automatically generating a signature in the docstring using arguments such as 'x' or 'x1, x2'. scipy.special has a lot of ufuncs, and for most of them, there are much more

Re: [Numpy-discussion] Add ability to disable the autogeneration of the function signature in a ufunc docstring.

2013-03-20 Thread Warren Weckesser
On Fri, Mar 15, 2013 at 4:39 PM, Nathaniel Smith n...@pobox.com wrote: On Fri, Mar 15, 2013 at 6:47 PM, Warren Weckesser warren.weckes...@gmail.com wrote: Hi all, In a recent scipy pull request (https://github.com/scipy/scipy/pull/459), I ran into the problem of ufuncs automatically

Re: [Numpy-discussion] timezones and datetime64

2013-04-03 Thread Warren Weckesser
On 4/3/13, Benjamin Root ben.r...@ou.edu wrote: On Wed, Apr 3, 2013 at 7:52 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Personally, I never need finer resolution than seconds, nor more than a century, so it's no big deal to me, but just wondering A use case for finer

Re: [Numpy-discussion] int to binary

2013-04-29 Thread Warren Weckesser
On 4/29/13, josef.p...@gmail.com josef.p...@gmail.com wrote: Is there a available function to convert an int to binary representation as sequence of 0 and 1? binary_repr produces strings and is not vectorized np.binary_repr(5) '101' np.binary_repr(5, width=4) '0101'

Re: [Numpy-discussion] nanmean(), nanstd() and other missing functions for 1.8

2013-05-01 Thread Warren Weckesser
On Wed, May 1, 2013 at 10:14 AM, Daπid davidmen...@gmail.com wrote: On 1 May 2013 03:36, Benjamin Root ben.r...@ou.edu wrote: Are there any other functions that others feel are missing from numpy and would like to see for v1.8? Let's discuss them here. I would like to have sincos, to

Re: [Numpy-discussion] Lists and Join function needed

2013-05-04 Thread Warren Weckesser
On 5/4/13, Bakhtiyor Zokhidov bakhtiyor_zokhi...@mail.ru wrote: Hi, I have the following code which represents intersected point of each cell in the given two points, A(x0,y0) and B(x1,y1). def intersected_points(x0, x1, y0, y1): # slope m = (y1 - y0 )/( x1 - x0) # Boundary of the

Re: [Numpy-discussion] multivariate_normal issue with 'size' argument

2013-05-24 Thread Warren Weckesser
On 5/24/13, Emanuele Olivetti emanu...@relativita.com wrote: Interesting. Anyone able to reproduce what I observe? Yes. I'm also using Ubuntu 12.04. With numpy 1.6.1, I get the same error, but it works fine with numpy 1.7.1. Warren Emanuele On 05/24/2013 02:09 PM, Nicolas Rougier

Re: [Numpy-discussion] multivariate_normal issue with 'size' argument

2013-05-24 Thread Warren Weckesser
On 5/24/13, Peter Cock p.j.a.c...@googlemail.com wrote: On Fri, May 24, 2013 at 2:15 PM, Robert Kern robert.k...@gmail.com wrote: On Fri, May 24, 2013 at 9:12 AM, Peter Cock p.j.a.c...@googlemail.com wrote: On Fri, May 24, 2013 at 1:59 PM, Emanuele Olivetti emanu...@relativita.com wrote:

Re: [Numpy-discussion] multivariate_normal issue with 'size' argument

2013-05-24 Thread Warren Weckesser
On 5/24/13, Peter Cock p.j.a.c...@googlemail.com wrote: On Fri, May 24, 2013 at 2:47 PM, Warren Weckesser warren.weckes...@gmail.com wrote: Peter wrote: --- Successes --- 64 bit Linux: $ python2.6 Python

Re: [Numpy-discussion] multivariate_normal issue with 'size' argument

2013-05-24 Thread Warren Weckesser
On 5/24/13, Peter Cock p.j.a.c...@googlemail.com wrote: On Fri, May 24, 2013 at 3:02 PM, Warren Weckesser warren.weckes...@gmail.com wrote: On 5/24/13, Peter Cock p.j.a.c...@googlemail.com wrote: Warren wrote: Two more data points: On Ubuntu 12.04, using 64 bit builds of Python 2.7.4 (from

[Numpy-discussion] numpy tests errors and failures

2013-06-01 Thread Warren Weckesser
I'm getting a failure and two errors with the latest master branch: $ python -c import numpy; numpy.test('full') Running unit tests for numpy NumPy version 1.8.0.dev-dff8c94 NumPy is installed in /home/warren/local_numpy/lib/python2.7/site-packages/numpy Python version 2.7.4 |Anaconda 1.5.0

Re: [Numpy-discussion] numpy tests errors and failures

2013-06-01 Thread Warren Weckesser
On Sat, Jun 1, 2013 at 7:47 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Sat, Jun 1, 2013 at 4:50 PM, Warren Weckesser warren.weckes...@gmail.com wrote: I'm getting a failure and two errors with the latest master branch: $ python -c import numpy; numpy.test('full') Running

Re: [Numpy-discussion] numpy tests errors and failures

2013-06-01 Thread Warren Weckesser
On Sat, Jun 1, 2013 at 7:47 PM, Charles R Harris charlesr.har...@gmail.comwrote: On Sat, Jun 1, 2013 at 4:50 PM, Warren Weckesser warren.weckes...@gmail.com wrote: I'm getting a failure and two errors with the latest master branch: $ python -c import numpy; numpy.test('full') Running

Re: [Numpy-discussion] numpy tests errors and failures

2013-06-01 Thread Warren Weckesser
On Sat, Jun 1, 2013 at 8:56 PM, Warren Weckesser warren.weckes...@gmail.com wrote: On Sat, Jun 1, 2013 at 7:47 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sat, Jun 1, 2013 at 4:50 PM, Warren Weckesser warren.weckes...@gmail.com wrote: I'm getting a failure and two

Re: [Numpy-discussion] numpy tests errors and failures

2013-06-04 Thread Warren Weckesser
On Tue, Jun 4, 2013 at 7:52 AM, Warren Weckesser warren.weckes...@gmail.com wrote: On Tue, Jun 4, 2013 at 1:20 AM, Tim Burgess tim.burg...@noaa.gov wrote: On Sat, 2013-06-01 at 20:09 -0400, Warren Weckesser wrote: I'm using Ubuntu 12.04, so I suspect I won't be the only one who sees

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Warren Weckesser
On Wed, Jun 12, 2013 at 10:18 AM, Nathaniel Smith n...@pobox.com wrote: On Wed, Jun 12, 2013 at 1:28 PM, Matthew Brett matthew.br...@gmail.com wrote: On Wed, Jun 12, 2013 at 1:10 PM, Nathaniel Smith n...@pobox.com wrote: Personally I think that overloading np.empty is horribly ugly, will

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Warren Weckesser
On Wed, Jun 12, 2013 at 10:18 AM, Nathaniel Smith n...@pobox.com wrote: On Wed, Jun 12, 2013 at 1:28 PM, Matthew Brett matthew.br...@gmail.com wrote: On Wed, Jun 12, 2013 at 1:10 PM, Nathaniel Smith n...@pobox.com wrote: Personally I think that overloading np.empty is horribly ugly, will

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Warren Weckesser
On Wed, Jun 12, 2013 at 2:00 PM, Nathaniel Smith n...@pobox.com wrote: On 12 Jun 2013 18:20, Ralf Gommers ralf.gomm...@gmail.com wrote: On Wed, Jun 12, 2013 at 6:36 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Wed, Jun 12, 2013 at 5:10 AM, Nathaniel Smith

[Numpy-discussion] Seg. fault when running tests

2013-06-15 Thread Warren Weckesser
I'm getting a seg. fault in master when I run the tests. I'm on Ubuntu 12.04 64 bit, with Python 3.3.2 (64 bits): $ python3 -c import numpy as np; np.test('full') Running unit tests for numpy NumPy version 1.8.0.dev-fa5bc1c NumPy is installed in

Re: [Numpy-discussion] Seg. fault when running tests

2013-06-15 Thread Warren Weckesser
On Sat, Jun 15, 2013 at 11:43 AM, Warren Weckesser warren.weckes...@gmail.com wrote: I'm getting a seg. fault in master when I run the tests. I'm on Ubuntu 12.04 64 bit, with Python 3.3.2 (64 bits): $ python3 -c import numpy as np; np.test('full') Running unit tests for numpy NumPy

Re: [Numpy-discussion] Seg. fault when running tests

2013-06-15 Thread Warren Weckesser
On Sat, Jun 15, 2013 at 3:26 PM, Charles R Harris charlesr.har...@gmail.com wrote: On Sat, Jun 15, 2013 at 1:15 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 15.06.2013 21:12, Charles R Harris wrote: On Sat, Jun 15, 2013 at 9:50 AM, Warren Weckesser warren.weckes

Re: [Numpy-discussion] Seg. fault when running tests

2013-06-15 Thread Warren Weckesser
On Sat, Jun 15, 2013 at 3:15 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 15.06.2013 21:12, Charles R Harris wrote: On Sat, Jun 15, 2013 at 9:50 AM, Warren Weckesser warren.weckes...@gmail.com mailto:warren.weckes...@gmail.com wrote: On Sat, Jun 15, 2013 at 11:43

Re: [Numpy-discussion] Seg. fault when running tests

2013-06-15 Thread Warren Weckesser
On Sat, Jun 15, 2013 at 3:57 PM, Warren Weckesser warren.weckes...@gmail.com wrote: On Sat, Jun 15, 2013 at 3:15 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 15.06.2013 21:12, Charles R Harris wrote: On Sat, Jun 15, 2013 at 9:50 AM, Warren Weckesser warren.weckes

Re: [Numpy-discussion] Seg. fault when running tests

2013-06-15 Thread Warren Weckesser
On Sat, Jun 15, 2013 at 4:03 PM, Julian Taylor jtaylor.deb...@googlemail.com wrote: On 15.06.2013 21:57, Warren Weckesser wrote: On Sat, Jun 15, 2013 at 3:15 PM, Julian Taylor @warren, can you please bisect the commit causing this? Here's the culprit

[Numpy-discussion] TypeError when multiplying float64 and a big integer in Python 3.

2013-06-16 Thread Warren Weckesser
With Python 3.3.2 (64 bit), and numpy master: import numpy as np np.__version__ '1.8.0.dev-2a5c2c8' f = np.float64(1.0) i = 2**65 f*i Traceback (most recent call last): File stdin, line 1, in module TypeError: unsupported operand type(s) for *: 'numpy.float64' and 'int' Is this the

Re: [Numpy-discussion] TypeError when multiplying float64 and a big integer in Python 3.

2013-06-16 Thread Warren Weckesser
On Sun, Jun 16, 2013 at 12:56 PM, Warren Weckesser warren.weckes...@gmail.com wrote: With Python 3.3.2 (64 bit), and numpy master: import numpy as np np.__version__ '1.8.0.dev-2a5c2c8' f = np.float64(1.0) i = 2**65 f*i Traceback (most recent call last): File stdin, line 1

Re: [Numpy-discussion] flip array on axis

2013-07-10 Thread Warren Weckesser
On Wed, Jul 10, 2013 at 12:03 PM, Andreas Hilboll li...@hilboll.de wrote: On 10.07.2013 17:06, Matthew Brett wrote: Hi, On Wed, Jul 10, 2013 at 11:02 AM, Andreas Hilboll li...@hilboll.de wrote: Hi, there are np.flipud and np.fliplr methods to flip 2d arrays on the first and second

Re: [Numpy-discussion] What should be the result in some statistics corner cases?

2013-07-14 Thread Warren Weckesser
On 7/14/13, Charles R Harris charlesr.har...@gmail.com wrote: Some corner cases in the mean, var, std. *Empty arrays* I think these cases should either raise an error or just return nan. Warnings seem ineffective to me as they are only issued once by default. In [3]: ones(0).mean()

Re: [Numpy-discussion] retrieving original array locations from 2d argsort

2013-07-15 Thread Warren Weckesser
On 7/15/13, Moroney, Catherine M (398D) catherine.m.moro...@jpl.nasa.gov wrote: I know that there's an easy way to solve this problem, but I'm not sufficiently knowledgeable about numpy indexing to figure it out. Here is the problem: Take a 2-d array a, of any size. Sort it in ascending

Re: [Numpy-discussion] fresh performance hits: numpy.linalg.pinv 30% slowdown

2013-07-19 Thread Warren Weckesser
On 7/19/13, Yaroslav Halchenko li...@onerussian.com wrote: I have just added a few more benchmarks, and here they come http://www.onerussian.com/tmp/numpy-vbench/vb_vb_linalg.html#numpy-linalg-pinv-a-float32 it seems to be very recent so my only check based on 10 commits didn't pick it up yet

Re: [Numpy-discussion] NumPy-Discussion Digest, Vol 83, Issue 33

2013-08-20 Thread Warren Weckesser
On 8/20/13, rodrigo koblitz rodrigokobl...@gmail.com wrote: Hi, How I can do this: int(scipy.comb(20314,117)) ... OverflowError: cannot convert float infinity to integer I assume you mean `scipy.misc.comb`. If you give `comb` the argument `exact=True`, it will give the exact result as a

[Numpy-discussion] Warnings not raised by np.log in 32 bit build on Windows

2013-08-22 Thread Warren Weckesser
I'm investigating a test error in scipy 0.13.0 beta 1 that was reported by Christoph Gohlke. The scipy issue is here: https://github.com/scipy/scipy/issues/2771 I don't have a Windows environment to test it myself, but Christoph reported that this code: ``` import numpy as np data =

Re: [Numpy-discussion] numpy dot returns [nan nan nan]

2013-08-24 Thread Warren Weckesser
On 8/24/13, Tom Bennett tom.benn...@mail.zyzhu.net wrote: Hi All, I have two arrays, A and B.A is 3 x 100,000 and B is 100,000. If I do np.dot(A,B), I get [nan, nan, nan]. However, np.any(np.isnan(A))==False and np.any(no.isnan(B))==False. And also np.seterr(all='print') does not print

Re: [Numpy-discussion] numpy dot returns [nan nan nan]

2013-08-24 Thread Warren Weckesser
On 8/24/13, Warren Weckesser warren.weckes...@gmail.com wrote: On 8/24/13, Tom Bennett tom.benn...@mail.zyzhu.net wrote: Hi All, I have two arrays, A and B.A is 3 x 100,000 and B is 100,000. If I do np.dot(A,B), I get [nan, nan, nan]. However, np.any(np.isnan(A))==False and np.any(no.isnan

Re: [Numpy-discussion] numpy dot returns [nan nan nan]

2013-08-24 Thread Warren Weckesser
` and `y` generates the warning, as expected: In [5]: x*y /home/warren/anaconda/bin/ipython:1: RuntimeWarning: overflow encountered in multiply #!/home/warren/anaconda/bin/python Out[5]: array([ inf]) Warren On Sat, Aug 24, 2013 at 12:39 PM, Warren Weckesser warren.weckes...@gmail.com

Re: [Numpy-discussion] A bug in numpy.random.shuffle?

2013-09-05 Thread Warren Weckesser
On Thu, Sep 5, 2013 at 2:11 PM, Fernando Perez fperez@gmail.com wrote: Hi all, I just ran into this rather weird behavior: http://nbviewer.ipython.org/6453869 In summary, as far as I can tell, shuffle is misbehaving when acting on arrays that have structured dtypes. I've seen the

[Numpy-discussion] Unexpected casting result

2013-09-16 Thread Warren Weckesser
An unexpected casting result was just reported on stackoverflow: http://stackoverflow.com/questions/18833639/attributeerror-in-python-numpy-when-constructing-function-for-certain-values The following show the essence of the issue: In [1]: np.__version__ Out[1]: '1.9.0.dev-6ce65d8' In [2]:

Re: [Numpy-discussion] Unexpected casting result

2013-09-16 Thread Warren Weckesser
On Mon, Sep 16, 2013 at 1:54 PM, Warren Weckesser warren.weckes...@gmail.com wrote: An unexpected casting result was just reported on stackoverflow: http://stackoverflow.com/questions/18833639/attributeerror-in-python-numpy-when-constructing-function-for-certain-values The following show

Re: [Numpy-discussion] Valid algorithm for generating a 3D Wiener Process?

2013-09-25 Thread Warren Weckesser
On Wed, Sep 25, 2013 at 9:36 AM, Neal Becker ndbeck...@gmail.com wrote: David Goldsmith wrote: Is this a valid algorithm for generating a 3D Wiener process? (When I graph the results, they certainly look like potential Brownian motion tracks.) def Wiener3D(incr, N): r =

Re: [Numpy-discussion] Valid algorithm for generating a 3D Wiener Process?

2013-09-25 Thread Warren Weckesser
On Wed, Sep 25, 2013 at 12:51 PM, Warren Weckesser warren.weckes...@gmail.com wrote: On Wed, Sep 25, 2013 at 9:36 AM, Neal Becker ndbeck...@gmail.com wrote: David Goldsmith wrote: Is this a valid algorithm for generating a 3D Wiener process? (When I graph the results, they certainly

Re: [Numpy-discussion] Valid algorithm for generating a 3D Wiener Process?

2013-09-25 Thread Warren Weckesser
On Wed, Sep 25, 2013 at 1:41 PM, David Goldsmith d.l.goldsm...@gmail.comwrote: Thanks, guys. Yeah, I realized the problem w/ the uniform-increment-variable-direction approach this morning: physically, it ignores the fact that the particles hitting the particle being tracked are going to have

Re: [Numpy-discussion] numpy.savetxt to string?

2013-11-06 Thread Warren Weckesser
Which version of numpy are you using? I just tried it with 1.7.1, and it accepted a StringIO instance. The docstring says the first argument may be a filename or file handle ( http://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html#numpy.savetxt ). Warren On Wed, Nov 6, 2013

Re: [Numpy-discussion] (no subject)

2013-11-22 Thread Warren Weckesser
On Fri, Nov 22, 2013 at 4:23 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, I'm sorry if I missed something obvious - but is there a vectorized way to look for None in an array? In [3]: a = np.array([1, 1]) In [4]: a == object() Out[4]: array([False, False], dtype=bool) In [6]: a

[Numpy-discussion] git tag for version 1.8?

2013-12-19 Thread Warren Weckesser
Is version 1.8.0 tagged in git? I see tags up to 1.7.1. I suspect the tagging convention has changed in the git repo. How do I checkout v1.8.0? Warren ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] git tag for version 1.8?

2013-12-20 Thread Warren Weckesser
On 12/20/13, Charles R Harris charlesr.har...@gmail.com wrote: On Thu, Dec 19, 2013 at 10:16 PM, Warren Weckesser warren.weckes...@gmail.com wrote: Is version 1.8.0 tagged in git? I see tags up to 1.7.1. I suspect the tagging convention has changed in the git repo. How do I checkout

Re: [Numpy-discussion] bug in comparing object arrays to None (?)

2014-01-27 Thread Warren Weckesser
On Mon, Jan 27, 2014 at 3:43 PM, Charles G. Waldman char...@crunch.iowrote: Hi Numpy folks. I just noticed that comparing an array of type 'object' to None does not behave as I expected. Is this a feature or a bug? (I can take a stab at fixing it if it's a bug, as I believe it is).

Re: [Numpy-discussion] New (old) function proposal.

2014-02-19 Thread Warren Weckesser
On Tue, Feb 18, 2014 at 11:27 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Di, 2014-02-18 at 09:05 -0700, Charles R Harris wrote: Hi All, There is an old ticket, #1499, that suggest adding a segment_axis function. def segment_axis(a, length, overlap=0, axis=None,

Re: [Numpy-discussion] [RFC] should we argue for a matrix power operator, @@?

2014-03-15 Thread Warren Weckesser
On Sat, Mar 15, 2014 at 8:38 PM, josef.p...@gmail.com wrote: I think I wouldn't use anything like @@ often enough to remember it's meaning. I'd rather see english names for anything that is not **very** common. I find A@@-1 pretty ugly compared to inv(A) A@@(-0.5) might be nice (do we

[Numpy-discussion] assert_equal(-0.0, 0.0) fails.

2014-04-14 Thread Warren Weckesser
The test function numpy.testing.assert_equal fails when comparing -0.0 and 0.0: In [16]: np.testing.assert_equal(-0.0, 0.0) --- AssertionErrorTraceback (most recent call last)

Re: [Numpy-discussion] Test error with ATLAS, Windows 64 bit

2014-04-14 Thread Warren Weckesser
On Mon, Apr 14, 2014 at 2:59 PM, Matthew Brett matthew.br...@gmail.comwrote: Hi, With Carl Kleffner, I am trying to build a numpy 1.8.1 wheel for Windows 64-bit, and latest stable ATLAS. It works fine, apart from the following test failure:

Re: [Numpy-discussion] Easter Egg or what I am missing here?

2014-05-21 Thread Warren Weckesser
On 5/21/14, Siegfried Gonzi siegfried.go...@ed.ac.uk wrote: Please would anyone tell me the following is an undocumented bug otherwise I will lose faith in everything: == import numpy as np years = [2004,2005,2006,2007] dates = [20040501,20050601,20060801,20071001] for x in years:

[Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-12 Thread Warren Weckesser
I created a pull request (https://github.com/numpy/numpy/pull/4958) that defines the function `count_unique`. `count_unique` generates a contingency table from a collection of sequences. For example, In [7]: x = [1, 1, 1, 1, 2, 2, 2, 2, 2] In [8]: y = [3, 4, 3, 3, 3, 4, 5, 5, 5] In [9]:

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-12 Thread Warren Weckesser
On Tue, Aug 12, 2014 at 11:35 AM, Warren Weckesser warren.weckes...@gmail.com wrote: I created a pull request (https://github.com/numpy/numpy/pull/4958) that defines the function `count_unique`. `count_unique` generates a contingency table from a collection of sequences. For example

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-13 Thread Warren Weckesser
On Tue, Aug 12, 2014 at 12:51 PM, Eelco Hoogendoorn hoogendoorn.ee...@gmail.com wrote: ah yes, that's also an issue I was trying to deal with. the semantics I prefer in these type of operators, is (as a default), to have every array be treated as a sequence of keys, so if calling

  1   2   3   >