Re: [Numpy-discussion] scipy super pack installer for win32: please test

2008-10-22 Thread Bill Baxter
I'm getting a 404 on that url. --bb On Wed, Oct 22, 2008 at 7:36 PM, David Cournapeau [EMAIL PROTECTED] wrote: Hi, A quick note to mention I have generated a superpack installer for scipy, for testing purposes. This is similar to numpy superpack installer: the installer detects your CPU

Re: [Numpy-discussion] how to tell if a point is inside a polygon

2008-10-14 Thread Bill Baxter
On Tue, Oct 14, 2008 at 2:56 PM, Stéfan van der Walt [EMAIL PROTECTED] wrote: Hi Matthew Here is an implementation in Python, ctypes and in weave: http://mentat.za.net/source/pnpoly.tar.bz2 snarf Thanks! Looks better than what I wrote. --bb ___

Re: [Numpy-discussion] how to tell if a point is inside a polygon

2008-10-13 Thread Bill Baxter
On Tue, Oct 14, 2008 at 8:46 AM, Pierre GM [EMAIL PROTECTED] wrote: 2008/10/13 Mathew Yeates [EMAIL PROTECTED] Is there a routine in scipy for telling whether a point is inside a convex 4 sided polygon? Mathew, You could use OGR (www.gdal.org) Example - import osgeo.ogr

Re: [Numpy-discussion] Using 2-D arrays in Numeric Python (numpy)

2008-10-10 Thread Bill Baxter
On Sat, Oct 11, 2008 at 2:16 PM, Linda Seltzer [EMAIL PROTECTED] wrote: I would appreciate it if someone could answer my question without referring to subjects such as APIs and interfaces, since I am only concerned with a mathematical application at this time. In most tutorials, array examples

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread Bill Baxter
Anything that defeats the purpose of doing * imports is good in my book. :-) Seriously, willy nilly import of any package into the base namespace is just asking for trouble. Tell your class to import numpy as np, then there will be no chance of confusion. Then later tell them about from numpy

Re: [Numpy-discussion] huge array calculation speed

2008-07-10 Thread Bill Baxter
On Fri, Jul 11, 2008 at 5:55 AM, Anne Archibald [EMAIL PROTECTED] wrote: 2008/7/10 Dan Lussier [EMAIL PROTECTED]: We seem to get quite a few posts from people wanting some kind of spatial data structure (whether they know it or not). Would it make sense to come up with some kind of compiled

Re: [Numpy-discussion] prerelease proposal for matrix behavior

2008-04-25 Thread Bill Baxter
On Sat, Apr 26, 2008 at 10:27 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Fri, Apr 25, 2008 at 6:38 PM, Alan G Isaac [EMAIL PROTECTED] wrote: OK, we are not converging in time for the release. So can we at least raise a TypeError on scalar indexing of matrices, so that we remain free

Re: [Numpy-discussion] numpy release

2008-04-24 Thread Bill Baxter
On Thu, Apr 24, 2008 at 11:16 AM, Timothy Hochberg [EMAIL PROTECTED] wrote: [CHOP] The proposals thus far don't address two of the major issues I have with the matrix class: The thing that seems missing to me is support for LAPACK's banded and packed (triangular) storage formats. I don't

Re: [Numpy-discussion] numpy release

2008-04-24 Thread Bill Baxter
On Fri, Apr 25, 2008 at 10:23 AM, Christopher Barker [EMAIL PROTECTED] wrote: Alan G Isaac wrote: On Thu, 24 Apr 2008, Christopher Barker apparently wrote: I suppose a Vector can be either a (n,1) or a (1,n) matrix that allows single indexing. This bothers me. So, if X is 2

Re: [Numpy-discussion] Win32 installer: please test it

2008-04-13 Thread Bill Baxter
On Mon, Apr 14, 2008 at 10:07 AM, David Cournapeau [EMAIL PROTECTED] wrote: Jarrod Millman wrote: Hello, David Cournapeau has prepared a new win32 installer, which is aimed at solving the recurring problem of non working atlas on different sets of CPU. This installer simply checks

Re: [Numpy-discussion] Win32 installer: please test it

2008-04-13 Thread Bill Baxter
On Mon, Apr 14, 2008 at 1:08 PM, David Cournapeau [EMAIL PROTECTED] wrote: Bill Baxter wrote: Seems to work here now, too! It doesn't tell you in an easy to see place what version of SSE it decides to use. Do you think that's ok? I simply did not think it was useful information

Re: [Numpy-discussion] Does float16 exist?

2008-01-08 Thread Bill Baxter
If you're really going to try to do it, Charles, there's an implementation of float16 in the OpenEXR toolkit. http://www.openexr.com/ Or more precisely it's in the files in the Half/ directory of this: http://download.savannah.nongnu.org/releases/openexr/ilmbase-1.0.1.tar.gz I don't know if it's

Re: [Numpy-discussion] Does float16 exist?

2008-01-08 Thread Bill Baxter
On Jan 9, 2008 8:03 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Jan 8, 2008 1:58 PM, Bill Baxter [EMAIL PROTECTED] wrote: If you're really going to try to do it, Charles, there's an implementation of float16 in the OpenEXR toolkit. http://www.openexr.com/ Or more precisely it's

Re: [Numpy-discussion] Does float16 exist?

2008-01-08 Thread Bill Baxter
On Jan 9, 2008 9:18 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Jan 8, 2008 5:01 PM, Bill Baxter [EMAIL PROTECTED] wrote: On Jan 9, 2008 8:03 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Jan 8, 2008 1:58 PM, Bill Baxter [EMAIL PROTECTED] wrote: If you're really going to try

Re: [Numpy-discussion] Moving away from svn ?

2008-01-06 Thread Bill Baxter
http://www.selenic.com/mercurial/wiki/index.cgi/MergeProgram This is a bit puzzling. I understand better merging isn't the only reason to choose DVCS, but the above page basically says that Mercurial just uses whatever external merge program it can find. So the file-level merging sounds like it

Re: [Numpy-discussion] Moving away from svn ?

2008-01-06 Thread Bill Baxter
On Jan 6, 2008 6:38 PM, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: http://www.selenic.com/mercurial/wiki/index.cgi/MergeProgram This is a bit puzzling. I understand better merging isn't the only reason to choose DVCS, but the above page basically says that Mercurial just

[Numpy-discussion] Initial Hg experiences on Windows

2008-01-06 Thread Bill Baxter
I've been playing around with Hg on windows for an hour or so now. My overall impression is that the installation process isn't quite there yet. The basic binary installer goes very smoothly, and after that I was able to open up a prompt and type hg commands right away. But going through the

Re: [Numpy-discussion] Initial Hg experiences on Windows

2008-01-06 Thread Bill Baxter
On Jan 7, 2008 2:30 AM, David Cournapeau [EMAIL PROTECTED] wrote: to what the trade-offs are. It mentions batteries included binary distributions as one solution without giving any link. FIY, it seems you can find it here (I have not tried it): http://qct.sourceforge.net/Mercurial-BI.html

Re: [Numpy-discussion] Moving away from svn ?

2008-01-05 Thread Bill Baxter
On Jan 6, 2008 8:25 AM, Stefan van der Walt [EMAIL PROTECTED] wrote: I recall something you said to David last week, regarding merges with SVN: that a person never knows how to do it until *after* you've done it! We often make branches in scipy and numpy, and stand a lot to gain from a

Re: [Numpy-discussion] C or C++ package like NumPy?

2007-11-02 Thread Bill Baxter
2007/11/2, Bill Baxter [EMAIL PROTECTED]: On Nov 2, 2007 3:50 PM, Matthieu Brucher [EMAIL PROTECTED] wrote: You can look at Vigra (but I don't know if there is linear algebra, but there are views, multidimensional containers, ...). Thanks for the link. Hadn't heard of that one

[Numpy-discussion] C or C++ package like NumPy?

2007-11-01 Thread Bill Baxter
Does anyone know of a C or C++ library that's similar to NumPy? Seems like all the big C++ efforts are focused on linear algebra rather than general purpose multidimensional arrays. I've written a multidimensional array class in the D programming language with an API modeled loosely after

Re: [Numpy-discussion] C or C++ package like NumPy?

2007-11-01 Thread Bill Baxter
] wrote: http://www.oonumerics.org/blitz/ On Fri, 2 Nov 2007, Bill Baxter wrote: Does anyone know of a C or C++ library that's similar to NumPy? Seems like all the big C++ efforts are focused on linear algebra rather than general purpose multidimensional arrays. I've written

Re: [Numpy-discussion] C or C++ package like NumPy?

2007-11-01 Thread Bill Baxter
On Nov 2, 2007 3:50 PM, Matthieu Brucher [EMAIL PROTECTED] wrote: You can look at Vigra (but I don't know if there is linear algebra, but there are views, multidimensional containers, ...). Thanks for the link. Hadn't heard of that one. --bb ___

Re: [Numpy-discussion] A basic question on the dot function

2007-10-16 Thread Bill Baxter
On 10/17/07, Julien Hillairet [EMAIL PROTECTED] wrote: Hello, First of all, I'm sorry if this question had already been asked. I've searched on the gmane archive and elsewhere on internet, but I didn't found the answer to my question. As expected, the dot product of 2 'classical' vectors

Re: [Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray = numpy.array typemap to share?

2007-09-21 Thread Bill Baxter
On 9/21/07, Alexander Schmolck [EMAIL PROTECTED] wrote: David Cournapeau [EMAIL PROTECTED] writes: Alexander Schmolck wrote: Charles R Harris [EMAIL PROTECTED] writes: The automatic handling of pointers for the default allocation type is also convenient and makes it reasonable to

Re: [Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray = numpy.array typemap to share?

2007-09-05 Thread Bill Baxter
On 9/6/07, Christopher Barker [EMAIL PROTECTED] wrote: Bill Spotz wrote: However, I'm beginning to have my doubts about valarrays. I'm reading: Josuttis, Nicolai M. 1999. The C+= Standard Library: A Tutorial and Reference It's 8 years old now, but he writes: The valarray classes were not

Re: [Numpy-discussion] [SciPy-dev] PEP 368: Standard image protocol and class

2007-07-03 Thread Bill Baxter
I'm not subscribed to the main Python list, so I'll just ask here. It looks like the protocol doesn't support any floating point image formats, judging from the big table of formats in the PEP. These are becoming more important these days in computer graphics as a way to pass around high

Re: [Numpy-discussion] PCA - Principal Component Analysis

2007-06-25 Thread Bill Baxter
Except last I checked numpy.linalg doesn't have an efficient method for retrieving only a few PCA components. So yeh, you can do PCA but it will be *really* slow on most of the types of problems that PCA is usually used for. You need something like an ARPACK wrapper, which I think they have in

Re: [Numpy-discussion] VMWare Virtual Appliance of Ubuntu with numpy, scipy, matplotlib, and ipython available

2007-06-10 Thread Bill Baxter
For those who are not aware, I have just discovered that the graphics performance of VMWare Player is *MUCH* better than that of VMWare Server. The latter is apparently optimized for disconnected headless operation and access via a network, and so it uses some heavyweight remote protocol for all

Re: [Numpy-discussion] are there any numpy equivalents to MATLAB nnz(), sparse(), sparsity()?

2007-06-03 Thread Bill Baxter
There is a scipy.sparse package but it seems to be fairly limited currently. Anyway there's definitely nothing like MATLAB's ability to change a matrix to sparse and still use most of the algorithms on it. Good sparse support vs. not so much sparse support should probably be added to the big

Re: [Numpy-discussion] Vista installer?

2007-05-28 Thread Bill Baxter
No, there's a link in the middle of the page that says ALSO available for AMD 64bit, but the link you're looking for is in the upper right corner of the page, and is for Intel 32:

[Numpy-discussion] MAX_INT?

2007-05-22 Thread Bill Baxter
Is there a way to obtain the equivalent of MAX_INT for the integral types numpy knows about? I know about numpy.finfo for the floating point types, but is there anything like that for integral types? Thanks, --Bill ___ Numpy-discussion mailing list

Re: [Numpy-discussion] MAX_INT?

2007-05-22 Thread Bill Baxter
Great. Thanks! Is there a plan to expose that as numpy.iinfo? --bb On 5/23/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: Is there a way to obtain the equivalent of MAX_INT for the integral types numpy knows about? I know about numpy.finfo for the floating point types

Re: [Numpy-discussion] Unfortunate user experience with max()

2007-05-16 Thread Bill Baxter
On 5/17/07, Anne Archibald [EMAIL PROTECTED] wrote: Hi, Numpy has a max() function. It takes an array, and possibly some extra arguments (axis and default). Unfortunately, this means that numpy.max(-1.3,2,7) -1.3 This can lead to surprising bugs in code that either explicitly expects it to

Re: [Numpy-discussion] howto check arrays for equal (numpy 1.0b, array_equal is absent)? best way to copy?

2007-05-07 Thread Bill Baxter
On 5/7/07, dmitrey [EMAIL PROTECTED] wrote: hi all, I have some troubles with Python2.5+matplotlib, so now I'm using Python2.4.3. I failed to compile both numpy1.0.1 and 1.0.2 (Mandrake2007) so currently I'm using 1.0b. Howto check if numpy.array instances x and y are equal? (i.e. all

Re: [Numpy-discussion] matlab vs. python question

2007-05-04 Thread Bill Baxter
On 4/29/07, Benjamin Thyreau [EMAIL PROTECTED] wrote: Le Samedi 28 Avril 2007 20:03, Simon Berube a écrit: (...) On the other hand, if you are more interested in small projects where speed of development is more important than long term sustainability of the code Matlab is probably

Re: [Numpy-discussion] can't import repmat from numpy

2007-04-30 Thread Bill Baxter
It's not on the matlab page simpy because numpy.tile didn't exist when the page was created. It should be fixed. But repmat is still there in numpy.matlib (I think that was what it was called.) --bb On 4/30/07, dmitrey [EMAIL PROTECTED] wrote: if it was excluded for any reasons, corresponding

Re: [Numpy-discussion] matlab vs. python question

2007-04-25 Thread Bill Baxter
On 4/26/07, Robert Kern [EMAIL PROTECTED] wrote: Sturla Molden wrote: On 4/25/2007 8:34 PM, Robert Kern wrote: The things that I get annoyed with every time I have to read some Matlab code are the lack of namespaces and first-class function objects. Matlab does have first-class

Re: [Numpy-discussion] Getting subarray

2007-04-24 Thread Bill Baxter
Easy! a[b==i] --bb On 4/24/07, Tommy Grav [EMAIL PROTECTED] wrote: I have two arrays: a = numpy.array([0,1,2,3,4,5,6,7,8,9]) b = numpy.array([0,0,1,1,2,2,0,1,2,3]) I would like to get the part of a that corresponds to where b is equal to i. For example: i = 0 = ([0,1,6]) i = 1 =

Re: [Numpy-discussion] using the functions nonzero and where

2007-04-24 Thread Bill Baxter
On 4/21/07, Dennis Cooke [EMAIL PROTECTED] wrote: I'm an ex-Matlab user trying to come up to speed with python and numpy. Howdy. First, I hope you've checked out the page: http://www.scipy.org/NumPy_for_Matlab_Users I'm confused on how to use the Numpy functions nonzero() and where(). In

Re: [Numpy-discussion] C-API creating new copy of C data

2007-04-21 Thread Bill Baxter
On 4/22/07, Travis Oliphant [EMAIL PROTECTED] wrote: Bill Baxter wrote: What's the right way to make a new numpy array that's a copy of some C data? What do you mean by /copies/ the void * data pointer for you? Do you mean the API would 1) Create new memory for the array 2) Copy

Re: [Numpy-discussion] How to call methods from a class with custom matrices parameters with numpy arrays ?

2007-04-19 Thread Bill Baxter
representation of a numpy array to a simple C array and vice et versa), if I remember correctly. Yes, I will try to use this solution, I have trouble figuring how passing the output numpy array, Bill Baxter asked the same question today, at exactly the same time ;) Well, I saw on the docs

Re: [Numpy-discussion] Fastest distance matrix calc

2007-04-17 Thread Bill Baxter
Oops. Looks like I forgot to attach the test program that generated that output so you can tell what dist2g actually does. Funny thing is -- despite being written in C, hypot doesn't actually win any of the test cases for which it's applicable. --bb On 4/17/07, Bill Baxter [EMAIL PROTECTED

Re: [Numpy-discussion] Matlab Translation - sqrt elementwise

2007-04-17 Thread Bill Baxter
Be sure to check out the numpy examples page too. http://www.scipy.org/Numpy_Example_List Always a good resource if you're not sure how to call a particular command. --bb On 4/18/07, Miquel Poch [EMAIL PROTECTED] wrote: Hi, I've found the next expression write it in Matlab, Rtx =

Re: [Numpy-discussion] index of minimum of array

2007-04-13 Thread Bill Baxter
On 4/14/07, Hugo [EMAIL PROTECTED] wrote: Bill Baxter wrote: On 4/14/07, Alan Isaac [EMAIL PROTECTED] wrote: On 4/13/07, Tommy Grav [EMAIL PROTECTED] wrote: how do I find the index of the minimum value of an numpy array? Example a = array([1.,2.,0.4,3.]) I want the i=2 Just

Re: [Numpy-discussion] detecting shared data

2007-04-11 Thread Bill Baxter
On 4/12/07, Matthew Koichi Grimes [EMAIL PROTECTED] wrote: It's better than nothing. I basically want some sanity-check assert code that can assert that some arrays are in fact sub-arrays of another array. Your OWNDATA suggestion meets me halfway by allowing me to check that these sub-arrays

Re: [Numpy-discussion] combining two arrays into one

2007-04-10 Thread Bill Baxter
I'm pretty sure dstack([x,y]) is what you're after. --bb On 4/10/07, mark [EMAIL PROTECTED] wrote: Hello list - I want to combine two arrays into one, and I cannot find a clean way to do it. I have the following two arrays: x = array([[1, 2, 3], [4, 5, 6]]) y =

Re: [Numpy-discussion] Big list of Numpy Scipy user

2007-04-09 Thread Bill Baxter
On 4/9/07, Matt Knox [EMAIL PROTECTED] wrote: Andrew Straw strawman at astraw.com writes: Is there any place on the Wiki that lists all the known software that uses Numpy in some way? Great idea. I renamed the page to http://www.scipy.org/Projects so Numpy-only users wouldn't feel

[Numpy-discussion] Big list of Numpy Scipy users

2007-04-04 Thread Bill Baxter
On 4/4/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: Is there any place on the Wiki that lists all the known software that uses Numpy in some way? It would be nice to start collecting such a list if there isn't one already. Screenshots would be nice too

Re: [Numpy-discussion] question about standalone small software and teaching

2007-04-04 Thread Bill Baxter
Ok, I got another hopefully easy question: Why this: class Point(object): ... Instead of the style that's used in the Python tutorial in the 'classes' chapter: class Point: ... --bb On 4/5/07, Robert Kern [EMAIL PROTECTED] wrote: Sebastian Haase wrote: OK, but

Re: [Numpy-discussion] basic python questions

2007-04-04 Thread Bill Baxter
On 4/5/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: Ok, I got another hopefully easy question: Why this: class Point(object): ... Instead of the style that's used in the Python tutorial in the 'classes' chapter: class Point

Re: [Numpy-discussion] basic python questions

2007-04-04 Thread Bill Baxter
On 4/5/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: On 4/5/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: Ok, I got another hopefully easy question: Why this: class Point(object): ... Instead of the style that's used in the Python

[Numpy-discussion] List of Numpy users anywhere?

2007-04-03 Thread Bill Baxter
Is there any place on the Wiki that lists all the known software that uses Numpy in some way? I just started playing with the Inkscape vector drawing progam. It implements extensions using python, and I noticed that one of the extensions in the latest release uses numpy (and not Numeric or

[Numpy-discussion] Assembling an array from parts

2007-04-01 Thread Bill Baxter
What's the best way of assembling a big matrix from parts? I'm using lagrange multipliers to enforce constraints and this kind of matrix comes up a lot: [[ K, G], [ G.T , 0]] In matlab you can use the syntax [K G; G' zeros(nc)] In numpy I'm using vstack([ hstack([ K,G ]), hstack([

Re: [Numpy-discussion] converting scalar to array with dimension 1

2007-03-30 Thread Bill Baxter
atleast_1d will do the trick In [11]: a = 3 In [12]: a = atleast_1d(a) In [13]: shape(a) Out[13]: (1,) In [14]: a.shape # also works ;-) Out[14]: (1,) In [15]: a[0] Out[15]: 3 --bb On 3/30/07, Mark Bakker [EMAIL PROTECTED] wrote: Hello list - I have a function that normally accepts an

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Bill Baxter
On 3/30/07, Timothy Hochberg [EMAIL PROTECTED] wrote: Note, however that you can't (for instance) multiply column vector with a row vector: (c)(r) Traceback (most recent call last): ... TypeError: Cannot matrix multiply columns with anything That should be allowed. (N,1)*(1,M) is just

Re: [Numpy-discussion] matrix indexing question

2007-03-29 Thread Bill Baxter
On 3/30/07, Timothy Hochberg [EMAIL PROTECTED] wrote: On 3/29/07, Bill Baxter [EMAIL PROTECTED] wrote: On 3/30/07, Timothy Hochberg [EMAIL PROTECTED] wrote: Note, however that you can't (for instance) multiply column vector with a row vector: (c)(r) Traceback (most recent call

Re: [Numpy-discussion] matrix indexing question

2007-03-26 Thread Bill Baxter
On 3/27/07, Alan Isaac [EMAIL PROTECTED] wrote: On 3/27/07, Alan Isaac [EMAIL PROTECTED] wrote: May I see a use case where the desired return when iterating through a matrix is rows as matrices? That has never been what I wanted. On Tue, 27 Mar 2007, Bill Baxter wrote: AllMyPoints

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-25 Thread Bill Baxter
On 3/25/07, Colin J. Williams [EMAIL PROTECTED] wrote: Bill Baxter wrote: On 3/25/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: I don't know. Given our previous history with convenience functions with different calling semantics (anyone remember rand()?), I think

Re: [Numpy-discussion] matrix indexing question

2007-03-25 Thread Bill Baxter
On 3/26/07, Alan G Isaac [EMAIL PROTECTED] wrote: Em Dom, 2007-03-25 às 13:07 -0400, Alan G Isaac escreveu: x[1] matrix([[1, 0]]) feels wrong. (Similarly when iterating across rows.) On Sun, 25 Mar 2007, Paulo Jose da Silva e Silva apparently wrote: I think the point here is

Re: [Numpy-discussion] matrix indexing question

2007-03-25 Thread Bill Baxter
On 3/26/07, Colin J. Williams [EMAIL PROTECTED] wrote: Bill Baxter wrote: This may sound silly, but I really think seeing all those brackets is what makes it feel wrong. Matlab's output doesn't put it in your face that your 4 is really a matrix([[4]]), even though that's what

Re: [Numpy-discussion] New Operators in Python

2007-03-25 Thread Bill Baxter
On 3/26/07, Charles R Harris [EMAIL PROTECTED] wrote: What might work better is simply some sort of sign that causes a function to be parsed as infix, x @dot y for instance, although Python already uses @ for other things. I don't know what symbols are left unused at this point, maybe ! , $,

Re: [Numpy-discussion] matrix indexing question

2007-03-25 Thread Bill Baxter
in x: print item.__repr__() ... matrix([[1, 2]]) matrix([[3, 4]]) On Mon, 26 Mar 2007, Bill Baxter apparently wrote: This may sound silly, but I really think seeing all those brackets is what makes it feel wrong. I appreciate the agreement that it feels wrong, but I dispute

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/24/07, Anne Archibald [EMAIL PROTECTED] wrote: On 24/03/07, Bill Baxter [EMAIL PROTECTED] wrote: I mentioned in another thread Travis started on the scipy list that I would find it useful if there were a function like dot() that could multiply more than just two things. Here's

Re: [Numpy-discussion] Detect subclass of ndarray

2007-03-24 Thread Bill Baxter
On 3/24/07, Charles R Harris [EMAIL PROTECTED] wrote: On 3/23/07, Anne Archibald [EMAIL PROTECTED] wrote: On 23/03/07, Charles R Harris [EMAIL PROTECTED] wrote: Anyone, What is the easiest way to detect in python/C if an object is a subclass of ndarray? Um, how about

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/24/07, Steven H. Rogers [EMAIL PROTECTED] wrote: Anne Archibald wrote: P.S. reduce isn't even a numpy thing, it's one of python's much-neglected lispy functions. It looks like reduce(), map(), and filter() are going away for Python 3.0 since GvR believes that they are redundant

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/24/07, Anne Archibald [EMAIL PROTECTED] wrote: On 24/03/07, Bill Baxter [EMAIL PROTECTED] wrote: Nice, but how does that fare on things like mdot(a,(b,c),d) ? I'm pretty sure it doesn't handle it. I think an mdot that can only multiply things left to right comes up short compared

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/25/07, Perry Greenfield [EMAIL PROTECTED] wrote: On Mar 24, 2007, at 2:52 PM, Bill Baxter wrote: On 3/24/07, Steven H. Rogers [EMAIL PROTECTED] wrote: Anne Archibald wrote: P.S. reduce isn't even a numpy thing, it's one of python's much-neglected lispy functions. It looks

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/25/07, Steven H. Rogers [EMAIL PROTECTED] wrote: The generator expression PEP doesn't say this, but the Python 3000 planning PEP (http://www.python.org/dev/peps/pep-3100/) has map() and filter() on the 'to-be-removed' list with a parenthetic comment that they can stay. Removal of

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/25/07, Alan G Isaac [EMAIL PROTECTED] wrote: On Sun, 25 Mar 2007, Bill Baxter apparently wrote: So if one just changes the example to reduce(lambda s, a: s * a.myattr, data, 1) How does one write that in a simplified way using generator expressions without calling on reduce

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/25/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: I think it's fine for filter()/reduce()/map() to be taken out of builtins and moved to a standard module, but it's not clear that that's what they're going to do. That py3K web page just says remove reduce()... done

Re: [Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-24 Thread Bill Baxter
On 3/25/07, Robert Kern [EMAIL PROTECTED] wrote: Bill Baxter wrote: I don't know. Given our previous history with convenience functions with different calling semantics (anyone remember rand()?), I think it probably will confuse some people. I'd really like to see it on a cookbook page

Re: [Numpy-discussion] concatenating 1-D arrays to 2D

2007-03-23 Thread Bill Baxter
On 3/24/07, Sebastian Haase [EMAIL PROTECTED] wrote: Then of course, there's r_ and c_: c = numpy.c_[a,b] c = numpy.r_[a[None],b[None]].T --bb So, None is the same as newaxis - right? Yes, newaxis is None. None is newaxis. Same thing. I just don't see much advantage in

[Numpy-discussion] Simple multi-arg wrapper for dot()

2007-03-23 Thread Bill Baxter
I mentioned in another thread Travis started on the scipy list that I would find it useful if there were a function like dot() that could multiply more than just two things. Here's a sample implementation called 'mdot'. mdot(a,b,c,d) == dot(dot(dot(a,b),c),d) mdot(a,(b,c),d) ==

Re: [Numpy-discussion] Nonblocking Plots with Matplotlib

2007-03-20 Thread Bill Baxter
On 3/20/07, Christian [EMAIL PROTECTED] wrote: Bill Baxter wrote: I found out that my version of matplotlib (0.87.7) does not know all methods that ezplot is expecting to be known. Aha. Thanks for diagnosing the problem. Should be fixed in the latest ezplot I just uploaded to pypi

Re: [Numpy-discussion] Little module to get numpy examples

2007-03-20 Thread Bill Baxter
On 3/19/07, Bill Baxter [EMAIL PROTECTED] wrote: I wrote a little python module to go fetch the Numpy examples from the scipy wiki page, parse them, and print out entries. Is there a good place on the wiki for this? It didn't really seem right in the cookbook, and it doesn't quite fit

[Numpy-discussion] Little module to get numpy examples

2007-03-18 Thread Bill Baxter
recommended, though, because it re-downloads the examples page every time you call it. Caching to a local file is not currently supported.) You can also create your own instance of the NumpyExamples object if you feel like it Author: Bill Baxter Date of creation: March 19 2007 version: 0.1 License: public

[Numpy-discussion] Broadcasting for hstack, vstack etc

2007-03-15 Thread Bill Baxter
I just had a need to append a column of 1's to an array, and given how big numpy is on broadcasting I thought this might work: column_stack((m1,m2, 1)) But it doesn't. Is there any reason why that couldn't or shouldn't be made to work? --bb ___

Re: [Numpy-discussion] Nonblocking Plots with Matplotlib

2007-03-14 Thread Bill Baxter
) Just a thought -- -Sebastian Haase On 3/13/07, Bill Baxter [EMAIL PROTECTED] wrote: Howdy Folks, I was missing the good ole days of using Matlab back at the Uni when I could debug my code, stop at breakpoints and plot various data without fear of blocking the interpreter process

Re: [Numpy-discussion] Nonblocking Plots with Matplotlib

2007-03-14 Thread Bill Baxter
On 3/15/07, Bill Baxter [EMAIL PROTECTED] wrote: Thanks, Sebastian. I'll take a look at Pyro. Hadn't heard of it. I'm using just xmlrpclib with pickle right now. I took a look at Pyro -- it looks nice. The only thing I couldn't find, though, is how decouple the wx GUI on the server side from

[Numpy-discussion] Nonblocking Plots with Matplotlib

2007-03-13 Thread Bill Baxter
Howdy Folks, I was missing the good ole days of using Matlab back at the Uni when I could debug my code, stop at breakpoints and plot various data without fear of blocking the interpreter process. Using ipython -pylab is what has been suggested to me in the past, but the problem is I don't do my

Re: [Numpy-discussion] efficient norm of a vector

2007-03-13 Thread Bill Baxter
There is numpy.linalg.norm. Here's what it does: def norm(x, ord=None): x = asarray(x) nd = len(x.shape) if ord is None: # check the default case first and handle it immediately return sqrt(add.reduce((x.conj() * x).ravel().real)) if nd == 1: if ord == Inf:

[Numpy-discussion] Putting some random back into the top-level?

2007-03-09 Thread Bill Baxter
Has enough time passed with no top level random function that we can now put one back in? If I recall, the former top level rand() was basically removed because it didn't adhere to the shapes are always tuples convention. Has enough time passed now that we can put something like it back in the

[Numpy-discussion] linalg.lstsq for complex

2006-12-13 Thread Bill Baxter
Is this code from linalg.lstsq for the complex case correct? lapack_routine = lapack_lite.zgelsd lwork = 1 rwork = zeros((lwork,), real_t) work = zeros((lwork,),t) results = lapack_routine(m, n, n_rhs, a, m, bstar, ldb, s, rcond,